home *** CD-ROM | disk | FTP | other *** search
MacBinary | 2000-02-25 | 60.9 KB | [TEXT/CWIE] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Fri Feb 25 05:00:00 2000, modified Fri Feb 25 05:00:00 2000, creator 'CWIE', type ASCII, 61777 bytes "WESelecting.c" , at 0xf1d1 286 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [CWIE] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0d 57 45 53 65 6c 65 | 63 74 69 6e 67 2e 63 00 |..WESele|cting.c.|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 00 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 f1 51 00 | 00 01 1e b4 dc 03 20 b4 |......Q.|...... .|
|00000060| dc 03 20 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.. .....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 0c 93 00 00 |........|........|
|00000080| 2f 2a 0d 20 2a 09 57 45 | 53 65 6c 65 63 74 69 6e |/*. *.WE|Selectin|
|00000090| 67 2e 63 0d 20 2a 0d 20 | 2a 09 57 41 53 54 45 20 |g.c. *. |*.WASTE |
|000000a0| 50 52 4f 4a 45 43 54 0d | 20 2a 20 20 44 72 61 77 |PROJECT.| * Draw|
|000000b0| 69 6e 67 20 53 65 6c 65 | 63 74 69 6f 6e 73 2c 20 |ing Sele|ctions, |
|000000c0| 41 63 74 69 76 61 74 69 | 6e 67 2c 20 55 70 64 61 |Activati|ng, Upda|
|000000d0| 74 69 6e 67 2c 20 53 63 | 72 6f 6c 6c 69 6e 67 2c |ting, Sc|rolling,|
|000000e0| 20 65 74 63 2e 0d 20 2a | 0d 20 2a 20 20 43 6f 70 | etc.. *|. * Cop|
|000000f0| 79 72 69 67 68 74 20 28 | 63 29 20 31 39 39 33 2d |yright (|c) 1993-|
|00000100| 31 39 39 38 20 4d 61 72 | 63 6f 20 50 69 6f 76 61 |1998 Mar|co Piova|
|00000110| 6e 65 6c 6c 69 0d 20 2a | 09 41 6c 6c 20 52 69 67 |nelli. *|.All Rig|
|00000120| 68 74 73 20 52 65 73 65 | 72 76 65 64 0d 20 2a 0d |hts Rese|rved. *.|
|00000130| 20 2a 20 20 43 20 70 6f | 72 74 20 62 79 20 44 61 | * C po|rt by Da|
|00000140| 6e 20 43 72 65 76 69 65 | 72 0d 20 2a 0d 20 2a 2f |n Crevie|r. *. */|
|00000150| 0d 0d 2f 2a 0d 09 50 6f | 72 74 69 6f 6e 73 20 63 |../*..Po|rtions c|
|00000160| 6f 70 79 72 69 67 68 74 | 20 a9 20 31 39 39 38 2d |opyright| . 1998-|
|00000170| 32 30 30 30 20 62 79 20 | 41 70 70 6c 65 20 43 6f |2000 by |Apple Co|
|00000180| 6d 70 75 74 65 72 2c 20 | 49 6e 63 2e 20 41 6c 6c |mputer, |Inc. All|
|00000190| 20 72 69 67 68 74 73 20 | 72 65 73 65 72 76 65 64 | rights |reserved|
|000001a0| 2e 0d 0d 09 43 68 61 6e | 67 65 20 48 69 73 74 6f |....Chan|ge Histo|
|000001b0| 72 79 3a 0d 09 09 30 31 | 2f 30 37 2f 30 30 09 54 |ry:...01|/07/00.T|
|000001c0| 57 42 09 09 43 61 72 62 | 6f 6e 3a 20 72 65 67 69 |WB..Carb|on: regi|
|000001d0| 6f 6e 73 20 61 72 65 20 | 6f 70 61 71 75 65 2e 20 |ons are |opaque. |
|000001e0| 0d 09 09 31 31 2f 31 31 | 2f 39 39 09 54 57 42 09 |...11/11|/99.TWB.|
|000001f0| 09 53 65 74 20 63 75 72 | 73 6f 72 20 74 6f 20 61 |.Set cur|sor to a|
|00000200| 72 72 6f 77 20 6f 76 65 | 72 20 6f 62 6a 65 63 74 |rrow ove|r object|
|00000210| 73 20 74 68 61 74 20 68 | 61 76 65 20 63 6c 69 63 |s that h|ave clic|
|00000220| 6b 20 68 61 6e 64 6c 65 | 72 73 2e 20 0d 09 09 31 |k handle|rs. ...1|
|00000230| 31 2f 31 30 2f 39 39 09 | 54 57 42 09 09 43 6c 65 |1/10/99.|TWB..Cle|
|00000240| 61 6e 20 75 70 20 74 68 | 65 20 70 72 69 76 61 74 |an up th|e privat|
|00000250| 65 20 69 6e 74 65 72 66 | 61 63 65 73 2e 20 0d 09 |e interf|aces. ..|
|00000260| 09 31 30 2f 32 39 2f 39 | 38 09 54 57 42 09 09 5a |.10/29/9|8.TWB..Z|
|00000270| 6f 6f 6d 20 73 75 70 70 | 6f 72 74 2e 20 0d 2a 2f |oom supp|ort. .*/|
|00000280| 0d 0d 0d 23 69 6e 63 6c | 75 64 65 20 22 57 41 53 |...#incl|ude "WAS|
|00000290| 54 45 49 6e 74 66 2e 68 | 22 0d 0d 2f 2f 20 76 61 |TEIntf.h|"..// va|
|000002a0| 6c 75 65 73 20 66 6f 72 | 20 5f 57 45 41 72 72 6f |lues for| _WEArro|
|000002b0| 77 4f 66 66 73 65 74 20 | 61 63 74 69 6f 6e 20 70 |wOffset |action p|
|000002c0| 61 72 61 6d 65 74 65 72 | 3a 0d 0d 65 6e 75 6d 0d |arameter|:..enum.|
|000002d0| 7b 0d 09 2f 2f 20 70 6c | 61 69 6e 20 61 72 72 6f |{..// pl|ain arro|
|000002e0| 77 20 6b 65 79 73 0d 09 | 6b 47 6f 4c 65 66 74 09 |w keys..|kGoLeft.|
|000002f0| 09 09 3d 09 30 2c 0d 09 | 6b 47 6f 52 69 67 68 74 |..=.0,..|kGoRight|
|00000300| 09 09 3d 09 31 2c 0d 09 | 6b 47 6f 55 70 09 09 09 |..=.1,..|kGoUp...|
|00000310| 3d 09 32 2c 0d 09 6b 47 | 6f 44 6f 77 6e 09 09 09 |=.2,..kG|oDown...|
|00000320| 3d 09 33 2c 0d 0d 09 2f | 2f 20 6d 6f 64 69 66 69 |=.3,.../|/ modifi|
|00000330| 65 72 73 0d 09 6b 4f 70 | 74 69 6f 6e 09 09 09 3d |ers..kOp|tion...=|
|00000340| 09 34 2c 0d 09 6b 43 6f | 6d 6d 61 6e 64 09 09 3d |.4,..kCo|mmand..=|
|00000350| 09 38 2c 0d 0d 09 2f 2f | 20 6f 70 74 69 6f 6e 20 |.8,...//| option |
|00000360| 2b 20 61 72 72 6f 77 20 | 63 6f 6d 62 6f 73 0d 09 |+ arrow |combos..|
|00000370| 6b 47 6f 57 6f 72 64 53 | 74 61 72 74 09 3d 09 6b |kGoWordS|tart.=.k|
|00000380| 47 6f 4c 65 66 74 20 2b | 20 6b 4f 70 74 69 6f 6e |GoLeft +| kOption|
|00000390| 2c 0d 09 6b 47 6f 57 6f | 72 64 45 6e 64 09 09 3d |,..kGoWo|rdEnd..=|
|000003a0| 09 6b 47 6f 52 69 67 68 | 74 20 2b 20 6b 4f 70 74 |.kGoRigh|t + kOpt|
|000003b0| 69 6f 6e 2c 0d 09 6b 47 | 6f 50 61 67 65 53 74 61 |ion,..kG|oPageSta|
|000003c0| 72 74 09 3d 09 6b 47 6f | 55 70 20 2b 20 6b 4f 70 |rt.=.kGo|Up + kOp|
|000003d0| 74 69 6f 6e 2c 0d 09 6b | 47 6f 50 61 67 65 45 6e |tion,..k|GoPageEn|
|000003e0| 64 09 09 3d 09 6b 47 6f | 44 6f 77 6e 20 2b 20 6b |d..=.kGo|Down + k|
|000003f0| 4f 70 74 69 6f 6e 2c 0d | 0d 09 2f 2f 20 63 6f 6d |Option,.|..// com|
|00000400| 6d 61 6e 64 20 2b 20 61 | 72 72 6f 77 20 63 6f 6d |mand + a|rrow com|
|00000410| 62 6f 73 0d 09 6b 47 6f | 4c 69 6e 65 53 74 61 72 |bos..kGo|LineStar|
|00000420| 74 09 3d 09 6b 47 6f 4c | 65 66 74 20 2b 20 6b 43 |t.=.kGoL|eft + kC|
|00000430| 6f 6d 6d 61 6e 64 2c 0d | 09 6b 47 6f 4c 69 6e 65 |ommand,.|.kGoLine|
|00000440| 45 6e 64 09 09 3d 09 6b | 47 6f 52 69 67 68 74 20 |End..=.k|GoRight |
|00000450| 2b 20 6b 43 6f 6d 6d 61 | 6e 64 2c 0d 09 6b 47 6f |+ kComma|nd,..kGo|
|00000460| 54 65 78 74 53 74 61 72 | 74 09 3d 09 6b 47 6f 55 |TextStar|t.=.kGoU|
|00000470| 70 20 2b 20 6b 43 6f 6d | 6d 61 6e 64 2c 0d 09 6b |p + kCom|mand,..k|
|00000480| 47 6f 54 65 78 74 45 6e | 64 09 09 3d 09 6b 47 6f |GoTextEn|d..=.kGo|
|00000490| 44 6f 77 6e 20 2b 20 6b | 43 6f 6d 6d 61 6e 64 0d |Down + k|Command.|
|000004a0| 7d 3b 0d 0d 49 4e 4c 49 | 4e 45 20 70 61 73 63 61 |};..INLI|NE pasca|
|000004b0| 6c 20 76 6f 69 64 20 5f | 57 45 43 6c 65 61 72 48 |l void _|WEClearH|
|000004c0| 69 6c 69 74 65 42 69 74 | 28 76 6f 69 64 29 0d 7b |iliteBit|(void).{|
|000004d0| 0d 09 4c 4d 53 65 74 48 | 69 6c 69 74 65 4d 6f 64 |..LMSetH|iliteMod|
|000004e0| 65 28 4c 4d 47 65 74 48 | 69 6c 69 74 65 4d 6f 64 |e(LMGetH|iliteMod|
|000004f0| 65 28 29 20 26 20 30 78 | 37 46 29 3b 0d 7d 0d 0d |e() & 0x|7F);.}..|
|00000500| 73 74 61 74 69 63 20 42 | 6f 6f 6c 65 61 6e 20 53 |static B|oolean S|
|00000510| 4c 50 69 78 65 6c 54 6f | 43 68 61 72 0d 09 28 0d |LPixelTo|Char..(.|
|00000520| 09 09 57 45 4c 69 6e 65 | 52 65 63 20 2a 70 4c 69 |..WELine|Rec *pLi|
|00000530| 6e 65 2c 0d 09 09 63 6f | 6e 73 74 20 57 45 52 75 |ne,...co|nst WERu|
|00000540| 6e 41 74 74 72 69 62 75 | 74 65 73 20 2a 70 41 74 |nAttribu|tes *pAt|
|00000550| 74 72 73 2c 0d 09 09 50 | 74 72 20 70 53 65 67 6d |trs,...P|tr pSegm|
|00000560| 65 6e 74 2c 0d 09 09 53 | 49 6e 74 33 32 20 73 65 |ent,...S|Int32 se|
|00000570| 67 6d 65 6e 74 53 74 61 | 72 74 2c 0d 09 09 53 49 |gmentSta|rt,...SI|
|00000580| 6e 74 33 32 20 73 65 67 | 6d 65 6e 74 4c 65 6e 67 |nt32 seg|mentLeng|
|00000590| 74 68 2c 0d 09 09 4a 75 | 73 74 53 74 79 6c 65 43 |th,...Ju|stStyleC|
|000005a0| 6f 64 65 20 73 74 79 6c | 65 52 75 6e 50 6f 73 69 |ode styl|eRunPosi|
|000005b0| 74 69 6f 6e 2c 0d 09 09 | 57 45 48 61 6e 64 6c 65 |tion,...|WEHandle|
|000005c0| 20 68 57 45 2c 0d 09 09 | 76 6f 69 64 20 2a 63 61 | hWE,...|void *ca|
|000005d0| 6c 6c 62 61 63 6b 44 61 | 74 61 0d 09 29 0d 7b 0d |llbackDa|ta..).{.|
|000005e0| 23 69 66 20 21 57 41 53 | 54 45 5f 4f 42 4a 45 43 |#if !WAS|TE_OBJEC|
|000005f0| 54 53 0d 09 23 70 72 61 | 67 6d 61 20 75 6e 75 73 |TS..#pra|gma unus|
|00000600| 65 64 28 70 41 74 74 72 | 73 29 0d 23 65 6e 64 69 |ed(pAttr|s).#endi|
|00000610| 66 0d 09 73 74 72 75 63 | 74 20 53 4c 50 69 78 65 |f..struc|t SLPixe|
|00000620| 6c 54 6f 43 68 61 72 44 | 61 74 61 20 2a 63 64 20 |lToCharD|ata *cd |
|00000630| 3d 20 28 73 74 72 75 63 | 74 20 53 4c 50 69 78 65 |= (struc|t SLPixe|
|00000640| 6c 54 6f 43 68 61 72 44 | 61 74 61 20 2a 29 20 63 |lToCharD|ata *) c|
|00000650| 61 6c 6c 62 61 63 6b 44 | 61 74 61 3b 0d 09 57 45 |allbackD|ata;..WE|
|00000660| 50 74 72 20 70 57 45 20 | 3d 20 2a 68 57 45 3b 0d |Ptr pWE |= *hWE;.|
|00000670| 09 46 69 78 65 64 20 73 | 6c 6f 70 3b 0d 09 53 49 |.Fixed s|lop;..SI|
|00000680| 6e 74 31 36 20 63 54 79 | 70 65 3b 0d 09 46 69 78 |nt16 cTy|pe;..Fix|
|00000690| 65 64 20 6f 6c 64 57 69 | 64 74 68 3b 0d 23 69 66 |ed oldWi|dth;.#if|
|000006a0| 20 57 41 53 54 45 5f 4f | 42 4a 45 43 54 53 0d 09 | WASTE_O|BJECTS..|
|000006b0| 46 69 78 65 64 20 6f 62 | 6a 65 63 74 57 69 64 74 |Fixed ob|jectWidt|
|000006c0| 68 3b 0d 09 46 69 78 65 | 64 20 73 75 62 57 69 64 |h;..Fixe|d subWid|
|000006d0| 74 68 3b 0d 23 65 6e 64 | 69 66 0d 0d 09 2f 2f 20 |th;.#end|if...// |
|000006e0| 69 66 20 74 68 69 73 20 | 69 73 20 74 68 65 20 66 |if this |is the f|
|000006f0| 69 72 73 74 20 73 74 79 | 6c 65 20 72 75 6e 20 6f |irst sty|le run o|
|00000700| 6e 20 74 68 65 20 6c 69 | 6e 65 2c 20 73 75 62 74 |n the li|ne, subt|
|00000710| 72 61 63 74 20 70 65 6e | 20 69 6e 64 65 6e 74 20 |ract pen| indent |
|00000720| 66 72 6f 6d 20 70 69 78 | 65 6c 57 69 64 74 68 0d |from pix|elWidth.|
|00000730| 09 69 66 20 28 49 53 5f | 4c 45 46 54 4d 4f 53 54 |.if (IS_|LEFTMOST|
|00000740| 5f 52 55 4e 28 73 74 79 | 6c 65 52 75 6e 50 6f 73 |_RUN(sty|leRunPos|
|00000750| 69 74 69 6f 6e 29 29 0d | 09 7b 0d 09 09 63 64 2d |ition)).|.{...cd-|
|00000760| 3e 70 69 78 65 6c 57 69 | 64 74 68 20 2d 3d 20 42 |>pixelWi|dth -= B|
|00000770| 53 4c 28 5f 57 45 43 61 | 6c 63 50 65 6e 49 6e 64 |SL(_WECa|lcPenInd|
|00000780| 65 6e 74 28 70 4c 69 6e | 65 2c 20 70 57 45 2d 3e |ent(pLin|e, pWE->|
|00000790| 61 6c 69 67 6e 6d 65 6e | 74 2c 20 70 57 45 2d 3e |alignmen|t, pWE->|
|000007a0| 64 69 72 65 63 74 69 6f | 6e 29 2c 20 31 36 29 3b |directio|n), 16);|
|000007b0| 0d 09 7d 0d 0d 09 2f 2f | 20 69 66 20 70 69 78 65 |..}...//| if pixe|
|000007c0| 6c 57 69 64 74 68 20 69 | 73 20 67 6f 6e 65 20 6e |lWidth i|s gone n|
|000007d0| 65 67 61 74 69 76 65 20 | 61 6c 72 65 61 64 79 2c |egative |already,|
|000007e0| 20 74 68 65 20 70 6f 69 | 6e 74 20 69 73 20 6f 6e | the poi|nt is on|
|000007f0| 20 74 68 65 0d 09 2f 2f | 20 5f 6c 65 61 64 69 6e | the..//| _leadin|
|00000800| 67 5f 20 65 64 67 65 20 | 28 4e 4f 54 45 3a 20 77 |g_ edge |(NOTE: w|
|00000810| 61 73 20 74 72 61 69 6c | 69 6e 67 20 69 6e 20 57 |as trail|ing in W|
|00000820| 41 53 54 45 20 31 2e 32 | 29 20 6f 66 20 66 69 72 |ASTE 1.2|) of fir|
|00000830| 73 74 20 67 6c 79 70 68 | 0d 09 69 66 20 28 63 64 |st glyph|..if (cd|
|00000840| 2d 3e 70 69 78 65 6c 57 | 69 64 74 68 20 3c 3d 20 |->pixelW|idth <= |
|00000850| 30 29 0d 09 7b 0d 09 09 | 63 64 2d 3e 6f 66 66 73 |0)..{...|cd->offs|
|00000860| 65 74 20 3d 20 73 65 67 | 6d 65 6e 74 53 74 61 72 |et = seg|mentStar|
|00000870| 74 3b 0d 09 09 63 64 2d | 3e 65 64 67 65 20 3d 20 |t;...cd-|>edge = |
|00000880| 6b 4c 65 61 64 69 6e 67 | 45 64 67 65 3b 0d 09 09 |kLeading|Edge;...|
|00000890| 72 65 74 75 72 6e 20 74 | 72 75 65 3b 09 2f 2f 20 |return t|rue;.// |
|000008a0| 73 74 6f 70 20 6c 6f 6f | 70 69 6e 67 0d 09 7d 0d |stop loo|ping..}.|
|000008b0| 0d 09 6f 6c 64 57 69 64 | 74 68 20 3d 20 63 64 2d |..oldWid|th = cd-|
|000008c0| 3e 70 69 78 65 6c 57 69 | 64 74 68 3b 0d 0d 23 69 |>pixelWi|dth;..#i|
|000008d0| 66 20 57 41 53 54 45 5f | 4f 42 4a 45 43 54 53 0d |f WASTE_|OBJECTS.|
|000008e0| 09 69 66 20 28 70 41 74 | 74 72 73 2d 3e 72 75 6e |.if (pAt|trs->run|
|000008f0| 53 74 79 6c 65 2e 74 73 | 4f 62 6a 65 63 74 20 21 |Style.ts|Object !|
|00000900| 3d 20 6e 69 6c 29 0d 09 | 7b 0d 0d 09 09 2f 2f 20 |= nil)..|{....// |
|00000910| 45 4d 42 45 44 44 45 44 | 20 4f 42 4a 45 43 54 0d |EMBEDDED| OBJECT.|
|00000920| 09 09 2f 2f 20 63 61 6c | 63 75 6c 61 74 65 20 6f |..// cal|culate o|
|00000930| 62 6a 65 63 74 20 77 69 | 64 74 68 20 61 73 20 46 |bject wi|dth as F|
|00000940| 69 78 65 64 0d 09 09 6f | 62 6a 65 63 74 57 69 64 |ixed...o|bjectWid|
|00000950| 74 68 20 3d 20 42 53 4c | 28 28 2a 70 41 74 74 72 |th = BSL|((*pAttr|
|00000960| 73 2d 3e 72 75 6e 53 74 | 79 6c 65 2e 74 73 4f 62 |s->runSt|yle.tsOb|
|00000970| 6a 65 63 74 29 2d 3e 6f | 62 6a 65 63 74 53 69 7a |ject)->o|bjectSiz|
|00000980| 65 2e 68 2c 20 31 36 29 | 3b 0d 0d 09 09 2f 2f 20 |e.h, 16)|;....// |
|00000990| 73 75 62 74 72 61 63 74 | 20 6f 62 6a 65 63 74 20 |subtract| object |
|000009a0| 77 69 64 74 68 20 66 72 | 6f 6d 20 70 69 78 65 6c |width fr|om pixel|
|000009b0| 57 69 64 74 68 0d 09 09 | 63 64 2d 3e 70 69 78 65 |Width...|cd->pixe|
|000009c0| 6c 57 69 64 74 68 20 2d | 3d 20 6f 62 6a 65 63 74 |lWidth -|= object|
|000009d0| 57 69 64 74 68 3b 0d 0d | 23 69 66 20 57 41 53 54 |Width;..|#if WAST|
|000009e0| 45 5f 4f 42 4a 45 43 54 | 53 5f 41 52 45 5f 47 4c |E_OBJECT|S_ARE_GL|
|000009f0| 59 50 48 53 0d 0d 09 09 | 2f 2f 20 66 69 6e 64 20 |YPHS....|// find |
|00000a00| 6f 75 74 20 77 68 65 74 | 68 65 72 20 74 68 65 20 |out whet|her the |
|00000a10| 70 6f 69 6e 74 20 69 73 | 20 69 6e 20 74 68 65 20 |point is| in the |
|00000a20| 6c 65 66 74 6d 6f 73 74 | 20 68 61 6c 66 20 6f 66 |leftmost| half of|
|00000a30| 20 74 68 65 20 6f 62 6a | 65 63 74 2c 0d 09 09 2f | the obj|ect,.../|
|00000a40| 2f 20 69 6e 20 74 68 65 | 20 72 69 67 68 74 6d 6f |/ in the| rightmo|
|00000a50| 73 74 20 68 61 6c 66 20 | 6f 72 20 70 61 73 74 20 |st half |or past |
|00000a60| 74 68 65 20 6f 62 6a 65 | 63 74 0d 09 09 73 75 62 |the obje|ct...sub|
|00000a70| 57 69 64 74 68 20 3d 20 | 6f 62 6a 65 63 74 57 69 |Width = |objectWi|
|00000a80| 64 74 68 20 3e 3e 20 31 | 3b 09 2f 2f 20 64 69 76 |dth >> 1|;.// div|
|00000a90| 69 64 65 20 62 79 20 74 | 77 6f 0d 09 09 69 66 20 |ide by t|wo...if |
|00000aa0| 28 63 64 2d 3e 70 69 78 | 65 6c 57 69 64 74 68 20 |(cd->pix|elWidth |
|00000ab0| 2b 20 73 75 62 57 69 64 | 74 68 20 3c 20 30 29 0d |+ subWid|th < 0).|
|00000ac0| 09 09 7b 0d 09 09 09 63 | 64 2d 3e 6f 66 66 73 65 |..{....c|d->offse|
|00000ad0| 74 20 3d 20 73 65 67 6d | 65 6e 74 53 74 61 72 74 |t = segm|entStart|
|00000ae0| 3b 0d 09 09 09 63 64 2d | 3e 65 64 67 65 20 3d 20 |;....cd-|>edge = |
|00000af0| 6b 4c 65 61 64 69 6e 67 | 45 64 67 65 3b 09 09 2f |kLeading|Edge;../|
|00000b00| 2f 20 70 6f 69 6e 74 20 | 69 73 20 69 6e 20 6c 65 |/ point |is in le|
|00000b10| 66 74 6d 6f 73 74 20 68 | 61 6c 66 20 6f 66 20 6f |ftmost h|alf of o|
|00000b20| 62 6a 65 63 74 0d 09 09 | 7d 0d 09 09 65 6c 73 65 |bject...|}...else|
|00000b30| 0d 09 09 7b 0d 09 09 09 | 63 64 2d 3e 6f 66 66 73 |...{....|cd->offs|
|00000b40| 65 74 3d 20 73 65 67 6d | 65 6e 74 53 74 61 72 74 |et= segm|entStart|
|00000b50| 20 2b 20 31 3b 0d 09 09 | 09 69 66 20 28 63 64 2d | + 1;...|.if (cd-|
|00000b60| 3e 70 69 78 65 6c 57 69 | 64 74 68 20 3c 20 30 29 |>pixelWi|dth < 0)|
|00000b70| 0d 09 09 09 7b 0d 09 09 | 09 09 63 64 2d 3e 65 64 |....{...|..cd->ed|
|00000b80| 67 65 20 3d 20 6b 54 72 | 61 69 6c 69 6e 67 45 64 |ge = kTr|ailingEd|
|00000b90| 67 65 3b 0d 09 09 09 7d | 09 2f 2f 20 70 6f 69 6e |ge;....}|.// poin|
|00000ba0| 74 20 69 73 20 69 6e 20 | 72 69 67 68 74 6d 6f 73 |t is in |rightmos|
|00000bb0| 74 20 68 61 6c 66 20 6f | 66 20 6f 62 6a 65 63 74 |t half o|f object|
|00000bc0| 0d 09 09 09 65 6c 73 65 | 0d 09 09 09 7b 0d 09 09 |....else|....{...|
|00000bd0| 09 09 63 64 2d 3e 65 64 | 67 65 20 3d 20 6b 4c 65 |..cd->ed|ge = kLe|
|00000be0| 61 64 69 6e 67 45 64 67 | 65 3b 09 2f 2f 20 70 6f |adingEdg|e;.// po|
|00000bf0| 69 6e 74 20 69 73 20 70 | 61 73 74 20 6f 62 6a 65 |int is p|ast obje|
|00000c00| 63 74 0d 09 09 09 7d 0d | 09 09 7d 0d 23 65 6c 73 |ct....}.|..}.#els|
|00000c10| 65 0d 0d 09 09 2f 2f 20 | 66 69 6e 64 20 6f 75 74 |e....// |find out|
|00000c20| 20 77 68 65 74 68 65 72 | 20 74 68 65 20 70 6f 69 | whether| the poi|
|00000c30| 6e 74 20 69 73 20 69 6e | 20 74 68 65 20 6c 65 66 |nt is in| the lef|
|00000c40| 74 6d 6f 73 74 20 71 75 | 61 72 74 65 72 20 6f 66 |tmost qu|arter of|
|00000c50| 20 74 68 65 20 6f 62 6a | 65 63 74 2c 0d 09 09 2f | the obj|ect,.../|
|00000c60| 2f 20 69 6e 20 74 68 65 | 20 6d 69 64 64 6c 65 20 |/ in the| middle |
|00000c70| 68 61 6c 66 2c 20 69 6e | 20 74 68 65 20 72 69 67 |half, in| the rig|
|00000c80| 68 74 6d 6f 73 74 20 71 | 75 61 72 74 65 72 20 6f |htmost q|uarter o|
|00000c90| 72 20 70 61 73 74 20 74 | 68 65 20 6f 62 6a 65 63 |r past t|he objec|
|00000ca0| 74 0d 09 09 73 75 62 57 | 69 64 74 68 20 3d 20 6f |t...subW|idth = o|
|00000cb0| 62 6a 65 63 74 57 69 64 | 74 68 20 3e 3e 20 32 3b |bjectWid|th >> 2;|
|00000cc0| 09 2f 2f 20 64 69 76 69 | 64 65 20 62 79 20 66 6f |.// divi|de by fo|
|00000cd0| 75 72 0d 09 09 69 66 20 | 28 63 64 2d 3e 70 69 78 |ur...if |(cd->pix|
|00000ce0| 65 6c 57 69 64 74 68 20 | 2b 20 73 75 62 57 69 64 |elWidth |+ subWid|
|00000cf0| 74 68 20 3c 20 30 29 0d | 09 09 7b 0d 09 09 09 63 |th < 0).|..{....c|
|00000d00| 64 2d 3e 6f 66 66 73 65 | 74 20 3d 20 73 65 67 6d |d->offse|t = segm|
|00000d10| 65 6e 74 53 74 61 72 74 | 3b 0d 09 09 09 69 66 20 |entStart|;....if |
|00000d20| 28 63 64 2d 3e 70 69 78 | 65 6c 57 69 64 74 68 20 |(cd->pix|elWidth |
|00000d30| 2b 20 6f 62 6a 65 63 74 | 57 69 64 74 68 20 3c 20 |+ object|Width < |
|00000d40| 73 75 62 57 69 64 74 68 | 29 0d 09 09 09 7b 0d 09 |subWidth|)....{..|
|00000d50| 09 09 09 63 64 2d 3e 65 | 64 67 65 20 3d 20 6b 4c |...cd->e|dge = kL|
|00000d60| 65 61 64 69 6e 67 45 64 | 67 65 3b 09 2f 2f 20 70 |eadingEd|ge;.// p|
|00000d70| 6f 69 6e 74 20 69 73 20 | 69 6e 20 6c 65 66 74 6d |oint is |in leftm|
|00000d80| 6f 73 74 20 71 75 61 72 | 74 65 72 20 6f 66 20 6f |ost quar|ter of o|
|00000d90| 62 6a 65 63 74 0d 09 09 | 09 7d 0d 09 09 09 65 6c |bject...|.}....el|
|00000da0| 73 65 0d 09 09 09 7b 0d | 09 09 09 09 63 64 2d 3e |se....{.|....cd->|
|00000db0| 65 64 67 65 20 3d 20 6b | 4f 62 6a 65 63 74 45 64 |edge = k|ObjectEd|
|00000dc0| 67 65 3b 09 09 2f 2f 20 | 70 6f 69 6e 74 20 69 73 |ge;..// |point is|
|00000dd0| 20 69 6e 20 6d 69 64 64 | 6c 65 20 68 61 6c 66 20 | in midd|le half |
|00000de0| 6f 66 20 6f 62 6a 65 63 | 74 0d 09 09 09 7d 0d 09 |of objec|t....}..|
|00000df0| 09 7d 0d 09 09 65 6c 73 | 65 0d 09 09 7b 0d 09 09 |.}...els|e...{...|
|00000e00| 09 63 64 2d 3e 6f 66 66 | 73 65 74 20 3d 20 73 65 |.cd->off|set = se|
|00000e10| 67 6d 65 6e 74 53 74 61 | 72 74 20 2b 20 31 3b 0d |gmentSta|rt + 1;.|
|00000e20| 09 09 09 69 66 20 28 63 | 64 2d 3e 70 69 78 65 6c |...if (c|d->pixel|
|00000e30| 57 69 64 74 68 20 3c 20 | 30 29 0d 09 09 09 7b 0d |Width < |0)....{.|
|00000e40| 09 09 09 09 63 64 2d 3e | 65 64 67 65 20 3d 20 6b |....cd->|edge = k|
|00000e50| 54 72 61 69 6c 69 6e 67 | 45 64 67 65 3b 09 2f 2f |Trailing|Edge;.//|
|00000e60| 20 70 6f 69 6e 74 20 69 | 73 20 69 6e 20 72 69 67 | point i|s in rig|
|00000e70| 68 74 6d 6f 73 74 20 71 | 75 61 72 74 65 72 20 6f |htmost q|uarter o|
|00000e80| 66 20 6f 62 6a 65 63 74 | 0d 09 09 09 7d 0d 09 09 |f object|....}...|
|00000e90| 09 65 6c 73 65 0d 09 09 | 09 7b 0d 09 09 09 09 63 |.else...|.{.....c|
|00000ea0| 64 2d 3e 65 64 67 65 20 | 3d 20 6b 4c 65 61 64 69 |d->edge |= kLeadi|
|00000eb0| 6e 67 45 64 67 65 3b 09 | 09 2f 2f 20 70 6f 69 6e |ngEdge;.|.// poin|
|00000ec0| 74 20 69 73 20 70 61 73 | 74 20 6f 62 6a 65 63 74 |t is pas|t object|
|00000ed0| 0d 09 09 09 7d 0d 09 09 | 7d 0d 23 65 6e 64 69 66 |....}...|}.#endif|
|00000ee0| 20 2f 2f 20 57 41 53 54 | 45 5f 4f 42 4a 45 43 54 | // WAST|E_OBJECT|
|00000ef0| 53 5f 41 52 45 5f 47 4c | 59 50 48 53 0d 09 7d 0d |S_ARE_GL|YPHS..}.|
|00000f00| 09 65 6c 73 65 0d 23 65 | 6e 64 69 66 20 2f 2f 20 |.else.#e|ndif // |
|00000f10| 57 41 53 54 45 5f 4f 42 | 4a 45 43 54 53 0d 09 7b |WASTE_OB|JECTS..{|
|00000f20| 0d 0d 09 09 2f 2f 20 52 | 45 47 55 4c 41 52 20 54 |....// R|EGULAR T|
|00000f30| 45 58 54 0d 0d 09 09 2f | 2f 20 69 66 20 74 68 69 |EXT..../|/ if thi|
|00000f40| 73 20 69 73 20 74 68 65 | 20 6c 61 73 74 20 73 65 |s is the| last se|
|00000f50| 67 6d 65 6e 74 20 6f 6e | 20 74 68 65 20 6c 69 6e |gment on| the lin|
|00000f60| 65 2c 20 73 74 72 69 70 | 20 74 68 65 20 6c 61 73 |e, strip| the las|
|00000f70| 74 20 62 6c 61 6e 6b 20 | 63 68 61 72 61 63 74 65 |t blank |characte|
|00000f80| 72 20 28 69 66 20 61 6e | 79 29 2c 0d 09 09 2f 2f |r (if an|y),...//|
|00000f90| 20 75 6e 6c 65 73 73 20 | 69 74 20 69 73 20 74 68 | unless |it is th|
|00000fa0| 65 20 6c 61 73 74 20 6e | 6f 6e 2d 43 52 20 63 68 |e last n|on-CR ch|
|00000fb0| 61 72 61 63 74 65 72 20 | 69 6e 20 74 68 65 20 77 |aracter |in the w|
|00000fc0| 68 6f 6c 65 20 74 65 78 | 74 20 73 74 72 65 61 6d |hole tex|t stream|
|00000fd0| 0d 09 09 69 66 20 28 49 | 53 5f 52 49 47 48 54 4d |...if (I|S_RIGHTM|
|00000fe0| 4f 53 54 5f 52 55 4e 28 | 73 74 79 6c 65 52 75 6e |OST_RUN(|styleRun|
|00000ff0| 50 6f 73 69 74 69 6f 6e | 29 29 0d 09 09 7b 0d 09 |Position|))...{..|
|00001000| 09 09 69 66 20 28 28 73 | 65 67 6d 65 6e 74 53 74 |..if ((s|egmentSt|
|00001010| 61 72 74 20 2b 20 73 65 | 67 6d 65 6e 74 4c 65 6e |art + se|gmentLen|
|00001020| 67 74 68 20 3c 20 70 57 | 45 2d 3e 74 65 78 74 4c |gth < pW|E->textL|
|00001030| 65 6e 67 74 68 29 20 7c | 7c 0d 09 09 09 09 70 53 |ength) |||.....pS|
|00001040| 65 67 6d 65 6e 74 5b 73 | 65 67 6d 65 6e 74 4c 65 |egment[s|egmentLe|
|00001050| 6e 67 74 68 20 2d 20 31 | 5d 20 3d 3d 20 6b 45 4f |ngth - 1|] == kEO|
|00001060| 4c 29 0d 09 09 09 7b 0d | 09 09 09 09 63 54 79 70 |L)....{.|....cTyp|
|00001070| 65 20 3d 20 43 61 6c 6c | 57 45 43 68 61 72 54 79 |e = Call|WECharTy|
|00001080| 70 65 50 72 6f 63 28 70 | 53 65 67 6d 65 6e 74 2c |peProc(p|Segment,|
|00001090| 20 73 65 67 6d 65 6e 74 | 4c 65 6e 67 74 68 20 2d | segment|Length -|
|000010a0| 20 31 2c 20 46 6f 6e 74 | 53 63 72 69 70 74 28 29 | 1, Font|Script()|
|000010b0| 2c 0d 09 09 09 09 09 20 | 68 57 45 2c 20 70 57 45 |,...... |hWE, pWE|
|000010c0| 2d 3e 63 68 61 72 54 79 | 70 65 48 6f 6f 6b 29 3b |->charTy|peHook);|
|000010d0| 0d 09 09 09 09 69 66 20 | 28 28 63 54 79 70 65 20 |.....if |((cType |
|000010e0| 26 20 28 73 6d 63 54 79 | 70 65 4d 61 73 6b 20 2b |& (smcTy|peMask +|
|000010f0| 20 73 6d 63 43 6c 61 73 | 73 4d 61 73 6b 29 29 20 | smcClas|sMask)) |
|00001100| 3d 3d 20 73 6d 43 68 61 | 72 50 75 6e 63 74 20 2b |== smCha|rPunct +|
|00001110| 20 73 6d 50 75 6e 63 74 | 42 6c 61 6e 6b 29 0d 09 | smPunct|Blank)..|
|00001120| 09 09 09 7b 0d 09 09 09 | 09 09 73 65 67 6d 65 6e |...{....|..segmen|
|00001130| 74 4c 65 6e 67 74 68 20 | 2d 3d 20 28 28 63 54 79 |tLength |-= ((cTy|
|00001140| 70 65 20 26 20 73 6d 63 | 44 6f 75 62 6c 65 4d 61 |pe & smc|DoubleMa|
|00001150| 73 6b 29 20 3f 20 32 20 | 3a 20 31 29 3b 0d 09 09 |sk) ? 2 |: 1);...|
|00001160| 09 09 7d 0d 09 09 09 7d | 0d 09 09 7d 0d 0d 09 09 |..}....}|...}....|
|00001170| 2f 2f 20 63 61 6c 63 75 | 6c 61 74 65 20 73 6c 6f |// calcu|late slo|
|00001180| 70 20 66 6f 72 20 74 68 | 69 73 20 74 65 78 74 20 |p for th|is text |
|00001190| 73 65 67 6d 65 6e 74 20 | 28 6a 75 73 74 69 66 69 |segment |(justifi|
|000011a0| 65 64 20 74 65 78 74 20 | 6f 6e 6c 79 29 0d 09 09 |ed text |only)...|
|000011b0| 69 66 20 28 70 57 45 2d | 3e 61 6c 69 67 6e 6d 65 |if (pWE-|>alignme|
|000011c0| 6e 74 20 3d 3d 20 77 65 | 4a 75 73 74 69 66 79 29 |nt == we|Justify)|
|000011d0| 0d 09 09 7b 0d 23 69 66 | 20 57 41 53 54 45 5f 53 |...{.#if| WASTE_S|
|000011e0| 43 41 4c 45 0d 09 63 6f | 6e 73 74 20 50 6f 69 6e |CALE..co|nst Poin|
|000011f0| 74 20 73 63 61 6c 65 4e | 75 6d 65 72 20 3d 20 70 |t scaleN|umer = p|
|00001200| 57 45 2d 3e 73 63 61 6c | 65 4e 75 6d 65 72 3b 0d |WE->scal|eNumer;.|
|00001210| 09 63 6f 6e 73 74 20 50 | 6f 69 6e 74 20 73 63 61 |.const P|oint sca|
|00001220| 6c 65 44 65 6e 6f 6d 20 | 3d 20 70 57 45 2d 3e 73 |leDenom |= pWE->s|
|00001230| 63 61 6c 65 44 65 6e 6f | 6d 3b 0d 23 65 6c 73 65 |caleDeno|m;.#else|
|00001240| 0d 09 63 6f 6e 73 74 20 | 50 6f 69 6e 74 20 73 63 |..const |Point sc|
|00001250| 61 6c 65 4e 75 6d 65 72 | 20 3d 20 6b 4f 6e 65 54 |aleNumer| = kOneT|
|00001260| 6f 4f 6e 65 53 63 61 6c | 69 6e 67 3b 0d 09 63 6f |oOneScal|ing;..co|
|00001270| 6e 73 74 20 50 6f 69 6e | 74 20 73 63 61 6c 65 44 |nst Poin|t scaleD|
|00001280| 65 6e 6f 6d 20 3d 20 6b | 4f 6e 65 54 6f 4f 6e 65 |enom = k|OneToOne|
|00001290| 53 63 61 6c 69 6e 67 3b | 0d 23 65 6e 64 69 66 0d |Scaling;|.#endif.|
|000012a0| 0d 09 09 09 73 6c 6f 70 | 20 3d 20 46 69 78 4d 75 |....slop| = FixMu|
|000012b0| 6c 28 50 6f 72 74 69 6f | 6e 4c 69 6e 65 28 70 53 |l(Portio|nLine(pS|
|000012c0| 65 67 6d 65 6e 74 2c 20 | 73 65 67 6d 65 6e 74 4c |egment, |segmentL|
|000012d0| 65 6e 67 74 68 2c 20 73 | 74 79 6c 65 52 75 6e 50 |ength, s|tyleRunP|
|000012e0| 6f 73 69 74 69 6f 6e 2c | 0d 09 09 09 09 09 73 63 |osition,|......sc|
|000012f0| 61 6c 65 4e 75 6d 65 72 | 2c 20 73 63 61 6c 65 44 |aleNumer|, scaleD|
|00001300| 65 6e 6f 6d 29 2c 20 70 | 4c 69 6e 65 2d 3e 6c 69 |enom), p|Line->li|
|00001310| 6e 65 4a 75 73 74 41 6d | 6f 75 6e 74 29 3b 0d 09 |neJustAm|ount);..|
|00001320| 09 7d 0d 09 09 65 6c 73 | 65 0d 09 09 7b 0d 09 09 |.}...els|e...{...|
|00001330| 09 73 6c 6f 70 20 3d 20 | 30 3b 0d 09 09 7d 0d 0d |.slop = |0;...}..|
|00001340| 09 09 2f 2f 20 63 61 6c | 6c 20 50 69 78 65 6c 54 |..// cal|l PixelT|
|00001350| 6f 43 68 61 72 20 68 6f | 6f 6b 20 66 6f 72 20 74 |oChar ho|ok for t|
|00001360| 68 69 73 20 73 65 67 6d | 65 6e 74 0d 09 09 63 64 |his segm|ent...cd|
|00001370| 2d 3e 6f 66 66 73 65 74 | 20 3d 20 73 65 67 6d 65 |->offset| = segme|
|00001380| 6e 74 53 74 61 72 74 20 | 2b 20 43 61 6c 6c 57 45 |ntStart |+ CallWE|
|00001390| 50 69 78 65 6c 54 6f 43 | 68 61 72 50 72 6f 63 28 |PixelToC|harProc(|
|000013a0| 70 53 65 67 6d 65 6e 74 | 2c 20 73 65 67 6d 65 6e |pSegment|, segmen|
|000013b0| 74 4c 65 6e 67 74 68 2c | 0d 09 09 09 09 73 6c 6f |tLength,|.....slo|
|000013c0| 70 2c 20 26 63 64 2d 3e | 70 69 78 65 6c 57 69 64 |p, &cd->|pixelWid|
|000013d0| 74 68 2c 20 26 63 64 2d | 3e 65 64 67 65 2c 20 73 |th, &cd-|>edge, s|
|000013e0| 74 79 6c 65 52 75 6e 50 | 6f 73 69 74 69 6f 6e 2c |tyleRunP|osition,|
|000013f0| 20 63 64 2d 3e 68 50 6f | 73 2c 0d 09 09 09 09 68 | cd->hPo|s,.....h|
|00001400| 57 45 2c 20 70 57 45 2d | 3e 70 69 78 65 6c 54 6f |WE, pWE-|>pixelTo|
|00001410| 43 68 61 72 48 6f 6f 6b | 29 3b 0d 09 7d 0d 0d 09 |CharHook|);..}...|
|00001420| 2f 2f 20 69 6e 63 72 65 | 6d 65 6e 74 20 68 50 6f |// incre|ment hPo|
|00001430| 73 20 62 79 20 63 68 61 | 6e 67 65 20 69 6e 20 70 |s by cha|nge in p|
|00001440| 69 78 65 6c 57 69 64 74 | 68 0d 09 63 64 2d 3e 68 |ixelWidt|h..cd->h|
|00001450| 50 6f 73 20 2b 3d 20 28 | 6f 6c 64 57 69 64 74 68 |Pos += (|oldWidth|
|00001460| 20 2d 20 63 64 2d 3e 70 | 69 78 65 6c 57 69 64 74 | - cd->p|ixelWidt|
|00001470| 68 29 3b 0d 0d 09 2f 2f | 20 69 66 20 70 69 78 65 |h);...//| if pixe|
|00001480| 6c 57 69 64 74 68 20 68 | 61 73 20 67 6f 6e 65 20 |lWidth h|as gone |
|00001490| 6e 65 67 61 74 69 76 65 | 2c 20 77 65 27 72 65 20 |negative|, we're |
|000014a0| 66 69 6e 69 73 68 65 64 | 3b 20 6f 74 68 65 72 77 |finished|; otherw|
|000014b0| 69 73 65 20 67 6f 20 74 | 6f 20 6e 65 78 74 20 72 |ise go t|o next r|
|000014c0| 75 6e 0d 09 72 65 74 75 | 72 6e 20 28 63 64 2d 3e |un..retu|rn (cd->|
|000014d0| 70 69 78 65 6c 57 69 64 | 74 68 20 3c 3d 20 30 29 |pixelWid|th <= 0)|
|000014e0| 3b 0d 7d 0d 0d 70 61 73 | 63 61 6c 20 53 49 6e 74 |;.}..pas|cal SInt|
|000014f0| 33 32 20 57 45 47 65 74 | 4f 66 66 73 65 74 28 63 |32 WEGet|Offset(c|
|00001500| 6f 6e 73 74 20 4c 6f 6e | 67 50 74 20 2a 74 68 65 |onst Lon|gPt *the|
|00001510| 50 6f 69 6e 74 2c 20 57 | 45 45 64 67 65 20 2a 65 |Point, W|EEdge *e|
|00001520| 64 67 65 2c 20 57 45 48 | 61 6e 64 6c 65 20 68 57 |dge, WEH|andle hW|
|00001530| 45 29 0d 7b 0d 09 2f 2f | 20 67 69 76 65 6e 20 61 |E).{..//| given a|
|00001540| 20 6c 6f 6e 67 20 70 6f | 69 6e 74 20 69 6e 20 6c | long po|int in l|
|00001550| 6f 63 61 6c 20 63 6f 6f | 72 64 69 6e 61 74 65 73 |ocal coo|rdinates|
|00001560| 2c 0d 09 2f 2f 20 66 69 | 6e 64 20 74 68 65 20 74 |,..// fi|nd the t|
|00001570| 65 78 74 20 6f 66 66 73 | 65 74 20 63 6f 72 72 65 |ext offs|et corre|
|00001580| 73 70 6f 6e 64 69 6e 67 | 20 74 6f 20 74 68 65 20 |sponding| to the |
|00001590| 6e 65 61 72 65 73 74 20 | 67 6c 79 70 68 0d 0d 09 |nearest |glyph...|
|000015a0| 57 45 50 74 72 20 70 57 | 45 3b 0d 09 53 49 6e 74 |WEPtr pW|E;..SInt|
|000015b0| 33 32 20 6c 69 6e 65 49 | 6e 64 65 78 3b 0d 09 4c |32 lineI|ndex;..L|
|000015c0| 6f 6e 67 50 74 20 74 65 | 6d 70 50 6f 69 6e 74 3b |ongPt te|mpPoint;|
|000015d0| 0d 09 73 74 72 75 63 74 | 20 53 4c 50 69 78 65 6c |..struct| SLPixel|
|000015e0| 54 6f 43 68 61 72 44 61 | 74 61 20 63 64 3b 0d 09 |ToCharDa|ta cd;..|
|000015f0| 42 6f 6f 6c 65 61 6e 20 | 73 61 76 65 57 45 4c 6f |Boolean |saveWELo|
|00001600| 63 6b 3b 0d 0d 09 2f 2f | 20 6c 6f 63 6b 20 74 68 |ck;...//| lock th|
|00001610| 65 20 57 45 20 72 65 63 | 6f 72 64 0d 09 73 61 76 |e WE rec|ord..sav|
|00001620| 65 57 45 4c 6f 63 6b 20 | 3d 20 5f 57 45 53 65 74 |eWELock |= _WESet|
|00001630| 48 61 6e 64 6c 65 4c 6f | 63 6b 28 28 48 61 6e 64 |HandleLo|ck((Hand|
|00001640| 6c 65 29 20 68 57 45 2c | 20 74 72 75 65 29 3b 0d |le) hWE,| true);.|
|00001650| 09 70 57 45 20 3d 20 2a | 68 57 45 3b 0d 0d 09 2f |.pWE = *|hWE;.../|
|00001660| 2f 20 74 65 6d 70 50 6f | 69 6e 74 20 69 73 20 74 |/ tempPo|int is t|
|00001670| 68 65 50 6f 69 6e 74 2c | 20 72 65 6c 61 74 69 76 |hePoint,| relativ|
|00001680| 65 20 74 6f 20 74 68 65 | 20 74 6f 70 20 6c 65 66 |e to the| top lef|
|00001690| 74 20 63 6f 72 6e 65 72 | 20 6f 66 20 74 68 65 20 |t corner| of the |
|000016a0| 64 65 73 74 20 72 65 63 | 74 0d 09 74 65 6d 70 50 |dest rec|t..tempP|
|000016b0| 6f 69 6e 74 2e 76 20 3d | 20 74 68 65 50 6f 69 6e |oint.v =| thePoin|
|000016c0| 74 2d 3e 76 20 2d 20 70 | 57 45 2d 3e 64 65 73 74 |t->v - p|WE->dest|
|000016d0| 52 65 63 74 2e 74 6f 70 | 3b 0d 09 74 65 6d 70 50 |Rect.top|;..tempP|
|000016e0| 6f 69 6e 74 2e 68 20 3d | 20 74 68 65 50 6f 69 6e |oint.h =| thePoin|
|000016f0| 74 2d 3e 68 20 2d 20 70 | 57 45 2d 3e 64 65 73 74 |t->h - p|WE->dest|
|00001700| 52 65 63 74 2e 6c 65 66 | 74 3b 0d 0d 09 2f 2f 20 |Rect.lef|t;...// |
|00001710| 69 66 20 74 68 65 20 70 | 6f 69 6e 74 20 69 73 20 |if the p|oint is |
|00001720| 61 62 6f 76 65 20 74 68 | 65 20 64 65 73 74 69 6e |above th|e destin|
|00001730| 61 74 69 6f 6e 20 72 65 | 63 74 2c 20 72 65 74 75 |ation re|ct, retu|
|00001740| 72 6e 20 7a 65 72 6f 0d | 09 69 66 20 28 74 65 6d |rn zero.|.if (tem|
|00001750| 70 50 6f 69 6e 74 2e 76 | 20 3c 20 30 29 0d 09 7b |pPoint.v| < 0)..{|
|00001760| 0d 09 09 63 64 2e 6f 66 | 66 73 65 74 20 3d 20 30 |...cd.of|fset = 0|
|00001770| 3b 0d 09 09 63 64 2e 65 | 64 67 65 20 3d 20 6b 54 |;...cd.e|dge = kT|
|00001780| 72 61 69 6c 69 6e 67 45 | 64 67 65 3b 0d 09 7d 0d |railingE|dge;..}.|
|00001790| 09 65 6c 73 65 0d 09 7b | 0d 09 09 2f 2f 20 69 66 |.else..{|...// if|
|000017a0| 20 74 68 65 20 70 6f 69 | 6e 74 20 69 73 20 62 65 | the poi|nt is be|
|000017b0| 6c 6f 77 20 74 68 65 20 | 6c 61 73 74 20 6c 69 6e |low the |last lin|
|000017c0| 65 2c 20 72 65 74 75 72 | 6e 20 6c 61 73 74 20 63 |e, retur|n last c|
|000017d0| 68 61 72 20 6f 66 66 73 | 65 74 0d 09 09 69 66 20 |har offs|et...if |
|000017e0| 28 74 65 6d 70 50 6f 69 | 6e 74 2e 76 20 3e 3d 20 |(tempPoi|nt.v >= |
|000017f0| 57 45 47 65 74 48 65 69 | 67 68 74 28 30 2c 20 4c |WEGetHei|ght(0, L|
|00001800| 4f 4e 47 5f 4d 41 58 2c | 20 68 57 45 29 29 0d 09 |ONG_MAX,| hWE))..|
|00001810| 09 7b 0d 09 09 09 63 64 | 2e 6f 66 66 73 65 74 20 |.{....cd|.offset |
|00001820| 3d 20 70 57 45 2d 3e 74 | 65 78 74 4c 65 6e 67 74 |= pWE->t|extLengt|
|00001830| 68 3b 0d 09 09 09 63 64 | 2e 65 64 67 65 20 3d 20 |h;....cd|.edge = |
|00001840| 6b 4c 65 61 64 69 6e 67 | 45 64 67 65 3b 0d 09 09 |kLeading|Edge;...|
|00001850| 7d 0d 09 09 65 6c 73 65 | 0d 09 09 7b 0d 09 09 09 |}...else|...{....|
|00001860| 2f 2f 20 66 69 6e 64 20 | 74 68 65 20 6c 69 6e 65 |// find |the line|
|00001870| 20 69 6e 64 65 78 20 63 | 6f 72 72 65 73 70 6f 6e | index c|orrespon|
|00001880| 64 69 6e 67 20 74 6f 20 | 74 68 65 20 76 65 72 74 |ding to |the vert|
|00001890| 69 63 61 6c 20 70 69 78 | 65 6c 20 6f 66 66 73 65 |ical pix|el offse|
|000018a0| 74 0d 09 09 09 6c 69 6e | 65 49 6e 64 65 78 20 3d |t....lin|eIndex =|
|000018b0| 20 5f 57 45 50 69 78 65 | 6c 54 6f 4c 69 6e 65 28 | _WEPixe|lToLine(|
|000018c0| 74 65 6d 70 50 6f 69 6e | 74 2e 76 2c 20 68 57 45 |tempPoin|t.v, hWE|
|000018d0| 29 3b 0d 0d 09 09 09 2f | 2f 20 65 78 70 72 65 73 |);...../|/ expres|
|000018e0| 73 20 74 68 65 20 68 6f | 72 69 7a 6f 6e 74 61 6c |s the ho|rizontal|
|000018f0| 20 70 69 78 65 6c 20 6f | 66 66 73 65 74 20 61 73 | pixel o|ffset as|
|00001900| 20 61 20 46 69 78 65 64 | 20 76 61 6c 75 65 0d 09 | a Fixed| value..|
|00001910| 09 09 63 64 2e 70 69 78 | 65 6c 57 69 64 74 68 20 |..cd.pix|elWidth |
|00001920| 3d 20 42 53 4c 28 74 65 | 6d 70 50 6f 69 6e 74 2e |= BSL(te|mpPoint.|
|00001930| 68 2c 20 31 36 29 3b 0d | 0d 09 09 09 2f 2f 20 77 |h, 16);.|....// w|
|00001940| 61 6c 6b 20 74 68 72 6f | 75 67 68 20 74 68 65 20 |alk thro|ugh the |
|00001950| 73 65 67 6d 65 6e 74 73 | 20 6f 6e 20 74 68 69 73 |segments| on this|
|00001960| 20 6c 69 6e 65 20 63 61 | 6c 6c 69 6e 67 20 50 69 | line ca|lling Pi|
|00001970| 78 65 6c 54 6f 43 68 61 | 72 0d 09 09 09 63 64 2e |xelToCha|r....cd.|
|00001980| 68 50 6f 73 20 3d 20 30 | 3b 0d 09 09 09 63 64 2e |hPos = 0|;....cd.|
|00001990| 6f 66 66 73 65 74 20 3d | 20 30 3b 0d 09 09 09 5f |offset =| 0;...._|
|000019a0| 57 45 53 65 67 6d 65 6e | 74 4c 6f 6f 70 28 6c 69 |WESegmen|tLoop(li|
|000019b0| 6e 65 49 6e 64 65 78 2c | 20 6c 69 6e 65 49 6e 64 |neIndex,| lineInd|
|000019c0| 65 78 2c 20 53 4c 50 69 | 78 65 6c 54 6f 43 68 61 |ex, SLPi|xelToCha|
|000019d0| 72 2c 20 26 63 64 2c 20 | 68 57 45 29 3b 0d 09 09 |r, &cd, |hWE);...|
|000019e0| 7d 0d 09 7d 0d 0d 09 2f | 2f 20 75 6e 6c 6f 63 6b |}..}.../|/ unlock|
|000019f0| 20 74 68 65 20 57 45 20 | 72 65 63 6f 72 64 0d 09 | the WE |record..|
|00001a00| 5f 57 45 53 65 74 48 61 | 6e 64 6c 65 4c 6f 63 6b |_WESetHa|ndleLock|
|00001a10| 28 28 48 61 6e 64 6c 65 | 29 20 68 57 45 2c 20 73 |((Handle|) hWE, s|
|00001a20| 61 76 65 57 45 4c 6f 63 | 6b 29 3b 0d 0d 09 2f 2f |aveWELoc|k);...//|
|00001a30| 20 72 65 74 75 72 6e 20 | 6f 66 66 73 65 74 2f 65 | return |offset/e|
|00001a40| 64 67 65 20 70 61 69 72 | 0d 09 69 66 20 28 65 64 |dge pair|..if (ed|
|00001a50| 67 65 20 21 3d 20 6e 69 | 6c 29 0d 09 7b 0d 09 09 |ge != ni|l)..{...|
|00001a60| 2a 65 64 67 65 20 3d 20 | 63 64 2e 65 64 67 65 3b |*edge = |cd.edge;|
|00001a70| 0d 09 7d 0d 09 72 65 74 | 75 72 6e 20 63 64 2e 6f |..}..ret|urn cd.o|
|00001a80| 66 66 73 65 74 3b 0d 7d | 0d 0d 73 74 61 74 69 63 |ffset;.}|..static|
|00001a90| 20 42 6f 6f 6c 65 61 6e | 20 53 4c 43 68 61 72 54 | Boolean| SLCharT|
|00001aa0| 6f 50 69 78 65 6c 0d 09 | 28 0d 09 09 57 45 4c 69 |oPixel..|(...WELi|
|00001ab0| 6e 65 52 65 63 20 2a 70 | 4c 69 6e 65 2c 0d 09 09 |neRec *p|Line,...|
|00001ac0| 63 6f 6e 73 74 20 57 45 | 52 75 6e 41 74 74 72 69 |const WE|RunAttri|
|00001ad0| 62 75 74 65 73 20 2a 70 | 41 74 74 72 73 2c 0d 09 |butes *p|Attrs,..|
|00001ae0| 09 50 74 72 20 70 53 65 | 67 6d 65 6e 74 2c 0d 09 |.Ptr pSe|gment,..|
|00001af0| 09 53 49 6e 74 33 32 20 | 73 65 67 6d 65 6e 74 53 |.SInt32 |segmentS|
|00001b00| 74 61 72 74 2c 0d 09 09 | 53 49 6e 74 33 32 20 73 |tart,...|SInt32 s|
|00001b10| 65 67 6d 65 6e 74 4c 65 | 6e 67 74 68 2c 0d 09 09 |egmentLe|ngth,...|
|00001b20| 4a 75 73 74 53 74 79 6c | 65 43 6f 64 65 20 73 74 |JustStyl|eCode st|
|00001b30| 79 6c 65 52 75 6e 50 6f | 73 69 74 69 6f 6e 2c 0d |yleRunPo|sition,.|
|00001b40| 09 09 57 45 48 61 6e 64 | 6c 65 20 68 57 45 2c 0d |..WEHand|le hWE,.|
|00001b50| 09 09 76 6f 69 64 20 2a | 63 61 6c 6c 62 61 63 6b |..void *|callback|
|00001b60| 44 61 74 61 0d 09 29 0d | 7b 0d 09 73 74 72 75 63 |Data..).|{..struc|
|00001b70| 74 20 53 4c 43 68 61 72 | 54 6f 50 69 78 65 6c 44 |t SLChar|ToPixelD|
|00001b80| 61 74 61 20 2a 63 64 20 | 3d 20 28 73 74 72 75 63 |ata *cd |= (struc|
|00001b90| 74 20 53 4c 43 68 61 72 | 54 6f 50 69 78 65 6c 44 |t SLChar|ToPixelD|
|00001ba0| 61 74 61 20 2a 29 20 63 | 61 6c 6c 62 61 63 6b 44 |ata *) c|allbackD|
|00001bb0| 61 74 61 3b 0d 09 57 45 | 50 74 72 20 70 57 45 20 |ata;..WE|Ptr pWE |
|00001bc0| 3d 20 2a 68 57 45 3b 0d | 09 53 49 6e 74 33 32 20 |= *hWE;.|.SInt32 |
|00001bd0| 6f 66 66 73 65 74 3b 0d | 09 46 69 78 65 64 20 73 |offset;.|.Fixed s|
|00001be0| 6c 6f 70 3b 0d 09 53 49 | 6e 74 31 36 20 64 69 72 |lop;..SI|nt16 dir|
|00001bf0| 65 63 74 69 6f 6e 20 3d | 20 63 64 2d 3e 64 69 72 |ection =| cd->dir|
|00001c00| 65 63 74 69 6f 6e 3b 0d | 09 53 49 6e 74 31 36 20 |ection;.|.SInt16 |
|00001c10| 77 69 64 74 68 3b 0d 09 | 42 6f 6f 6c 65 61 6e 20 |width;..|Boolean |
|00001c20| 69 73 49 6e 53 65 67 6d | 65 6e 74 3b 0d 0d 09 2f |isInSegm|ent;.../|
|00001c30| 2f 20 63 61 6c 63 75 6c | 61 74 65 20 6f 66 66 73 |/ calcul|ate offs|
|00001c40| 65 74 20 72 65 6c 61 74 | 69 76 65 20 74 6f 20 62 |et relat|ive to b|
|00001c50| 65 67 69 6e 6e 69 6e 67 | 20 6f 66 20 73 65 67 6d |eginning| of segm|
|00001c60| 65 6e 74 0d 09 6f 66 66 | 73 65 74 20 3d 20 63 64 |ent..off|set = cd|
|00001c70| 2d 3e 6f 66 66 73 65 74 | 20 2d 20 73 65 67 6d 65 |->offset| - segme|
|00001c80| 6e 74 53 74 61 72 74 3b | 0d 0d 09 2f 2f 20 69 73 |ntStart;|...// is|
|00001c90| 20 6f 66 66 73 65 74 20 | 77 69 74 68 69 6e 20 74 | offset |within t|
|00001ca0| 68 69 73 20 73 65 67 6d | 65 6e 74 3f 0d 09 69 73 |his segm|ent?..is|
|00001cb0| 49 6e 53 65 67 6d 65 6e | 74 20 3d 20 28 28 6f 66 |InSegmen|t = ((of|
|00001cc0| 66 73 65 74 20 3e 3d 20 | 30 29 20 26 26 20 28 6f |fset >= |0) && (o|
|00001cd0| 66 66 73 65 74 20 3c 20 | 73 65 67 6d 65 6e 74 4c |ffset < |segmentL|
|00001ce0| 65 6e 67 74 68 29 29 3b | 0d 0d 09 2f 2f 20 69 66 |ength));|...// if|
|00001cf0| 20 74 68 69 73 20 69 73 | 20 74 68 65 20 66 69 72 | this is| the fir|
|00001d00| 73 74 20 73 74 79 6c 65 | 20 72 75 6e 20 6f 6e 20 |st style| run on |
|00001d10| 74 68 65 20 6c 69 6e 65 | 2c 20 61 64 64 20 70 65 |the line|, add pe|
|00001d20| 6e 20 69 6e 64 65 6e 74 | 20 74 6f 20 74 68 65 50 |n indent| to theP|
|00001d30| 6f 69 6e 74 2e 68 0d 09 | 69 66 20 28 49 53 5f 4c |oint.h..|if (IS_L|
|00001d40| 45 46 54 4d 4f 53 54 5f | 52 55 4e 28 73 74 79 6c |EFTMOST_|RUN(styl|
|00001d50| 65 52 75 6e 50 6f 73 69 | 74 69 6f 6e 29 29 0d 09 |eRunPosi|tion))..|
|00001d60| 7b 0d 09 09 63 64 2d 3e | 74 68 65 50 6f 69 6e 74 |{...cd->|thePoint|
|00001d70| 2d 3e 68 20 2b 3d 20 5f | 57 45 43 61 6c 63 50 65 |->h += _|WECalcPe|
|00001d80| 6e 49 6e 64 65 6e 74 28 | 70 4c 69 6e 65 2c 20 70 |nIndent(|pLine, p|
|00001d90| 57 45 2d 3e 61 6c 69 67 | 6e 6d 65 6e 74 2c 20 70 |WE->alig|nment, p|
|00001da0| 57 45 2d 3e 64 69 72 65 | 63 74 69 6f 6e 29 3b 0d |WE->dire|ction);.|
|00001db0| 09 7d 0d 0d 23 69 66 20 | 57 41 53 54 45 5f 4f 42 |.}..#if |WASTE_OB|
|00001dc0| 4a 45 43 54 53 0d 09 69 | 66 20 28 70 41 74 74 72 |JECTS..i|f (pAttr|
|00001dd0| 73 2d 3e 72 75 6e 53 74 | 79 6c 65 2e 74 73 4f 62 |s->runSt|yle.tsOb|
|00001de0| 6a 65 63 74 20 21 3d 20 | 6e 69 6c 29 0d 09 7b 0d |ject != |nil)..{.|
|00001df0| 0d 09 09 2f 2f 20 45 4d | 42 45 44 44 45 44 20 4f |...// EM|BEDDED O|
|00001e00| 42 4a 45 43 54 0d 09 09 | 77 69 64 74 68 20 3d 20 |BJECT...|width = |
|00001e10| 69 73 49 6e 53 65 67 6d | 65 6e 74 20 3f 20 30 20 |isInSegm|ent ? 0 |
|00001e20| 3a 20 28 2a 70 41 74 74 | 72 73 2d 3e 72 75 6e 53 |: (*pAtt|rs->runS|
|00001e30| 74 79 6c 65 2e 74 73 4f | 62 6a 65 63 74 29 2d 3e |tyle.tsO|bject)->|
|00001e40| 6f 62 6a 65 63 74 53 69 | 7a 65 2e 68 3b 0d 09 7d |objectSi|ze.h;..}|
|00001e50| 0d 09 65 6c 73 65 0d 23 | 65 6e 64 69 66 0d 09 7b |..else.#|endif..{|
|00001e60| 0d 09 09 2f 2f 20 52 45 | 47 55 4c 41 52 20 54 45 |...// RE|GULAR TE|
|00001e70| 58 54 0d 09 09 73 6c 6f | 70 20 3d 20 30 3b 0d 0d |XT...slo|p = 0;..|
|00001e80| 09 09 2f 2f 20 63 61 6c | 63 75 6c 61 74 65 20 73 |..// cal|culate s|
|00001e90| 6c 6f 70 20 66 6f 72 20 | 74 68 69 73 20 74 65 78 |lop for |this tex|
|00001ea0| 74 20 73 65 67 6d 65 6e | 74 20 28 6a 75 73 74 69 |t segmen|t (justi|
|00001eb0| 66 69 65 64 20 74 65 78 | 74 20 6f 6e 6c 79 29 0d |fied tex|t only).|
|00001ec0| 09 09 69 66 20 28 70 57 | 45 2d 3e 61 6c 69 67 6e |..if (pW|E->align|
|00001ed0| 6d 65 6e 74 20 3d 3d 20 | 77 65 4a 75 73 74 69 66 |ment == |weJustif|
|00001ee0| 79 29 0d 09 09 7b 0d 23 | 69 66 20 57 41 53 54 45 |y)...{.#|if WASTE|
|00001ef0| 5f 53 43 41 4c 45 0d 09 | 63 6f 6e 73 74 20 50 6f |_SCALE..|const Po|
|00001f00| 69 6e 74 20 73 63 61 6c | 65 4e 75 6d 65 72 20 3d |int scal|eNumer =|
|00001f10| 20 70 57 45 2d 3e 73 63 | 61 6c 65 4e 75 6d 65 72 | pWE->sc|aleNumer|
|00001f20| 3b 0d 09 63 6f 6e 73 74 | 20 50 6f 69 6e 74 20 73 |;..const| Point s|
|00001f30| 63 61 6c 65 44 65 6e 6f | 6d 20 3d 20 70 57 45 2d |caleDeno|m = pWE-|
|00001f40| 3e 73 63 61 6c 65 44 65 | 6e 6f 6d 3b 0d 23 65 6c |>scaleDe|nom;.#el|
|00001f50| 73 65 0d 09 63 6f 6e 73 | 74 20 50 6f 69 6e 74 20 |se..cons|t Point |
|00001f60| 73 63 61 6c 65 4e 75 6d | 65 72 20 3d 20 6b 4f 6e |scaleNum|er = kOn|
|00001f70| 65 54 6f 4f 6e 65 53 63 | 61 6c 69 6e 67 3b 0d 09 |eToOneSc|aling;..|
|00001f80| 63 6f 6e 73 74 20 50 6f | 69 6e 74 20 73 63 61 6c |const Po|int scal|
|00001f90| 65 44 65 6e 6f 6d 20 3d | 20 6b 4f 6e 65 54 6f 4f |eDenom =| kOneToO|
|00001fa0| 6e 65 53 63 61 6c 69 6e | 67 3b 0d 23 65 6e 64 69 |neScalin|g;.#endi|
|00001fb0| 66 0d 0d 09 09 09 73 6c | 6f 70 20 3d 20 46 69 78 |f.....sl|op = Fix|
|00001fc0| 4d 75 6c 28 50 6f 72 74 | 69 6f 6e 4c 69 6e 65 28 |Mul(Port|ionLine(|
|00001fd0| 70 53 65 67 6d 65 6e 74 | 2c 20 73 65 67 6d 65 6e |pSegment|, segmen|
|00001fe0| 74 4c 65 6e 67 74 68 2c | 20 73 74 79 6c 65 52 75 |tLength,| styleRu|
|00001ff0| 6e 50 6f 73 69 74 69 6f | 6e 2c 0d 09 09 09 09 73 |nPositio|n,.....s|
|00002000| 63 61 6c 65 4e 75 6d 65 | 72 2c 20 73 63 61 6c 65 |caleNume|r, scale|
|00002010| 44 65 6e 6f 6d 29 2c 20 | 70 4c 69 6e 65 2d 3e 6c |Denom), |pLine->l|
|00002020| 69 6e 65 4a 75 73 74 41 | 6d 6f 75 6e 74 29 3b 0d |ineJustA|mount);.|
|00002030| 09 09 7d 0d 0d 09 09 69 | 66 20 28 42 54 53 54 28 |..}....i|f (BTST(|
|00002040| 70 57 45 2d 3e 66 6c 61 | 67 73 2c 20 77 65 46 42 |pWE->fla|gs, weFB|
|00002050| 69 64 69 72 65 63 74 69 | 6f 6e 61 6c 29 29 0d 09 |idirecti|onal))..|
|00002060| 09 7b 0d 09 09 09 2f 2f | 09 53 50 45 43 49 41 4c |.{....//|.SPECIAL|
|00002070| 20 54 52 45 41 54 4d 45 | 4e 54 20 46 4f 52 20 42 | TREATME|NT FOR B|
|00002080| 49 44 49 52 45 43 54 49 | 4f 4e 41 4c 20 53 43 52 |IDIRECTI|ONAL SCR|
|00002090| 49 50 54 53 0d 09 09 09 | 42 6f 6f 6c 65 61 6e 09 |IPTS....|Boolean.|
|000020a0| 73 65 67 6d 65 6e 74 44 | 69 72 20 3d 20 28 42 54 |segmentD|ir = (BT|
|000020b0| 53 54 28 70 41 74 74 72 | 73 2d 3e 72 75 6e 53 74 |ST(pAttr|s->runSt|
|000020c0| 79 6c 65 2e 74 73 46 6c | 61 67 73 2c 20 74 73 52 |yle.tsFl|ags, tsR|
|000020d0| 69 67 68 74 54 6f 4c 65 | 66 74 29 20 21 3d 20 30 |ightToLe|ft) != 0|
|000020e0| 29 3b 0d 0d 09 09 09 69 | 66 20 28 28 6f 66 66 73 |);.....i|f ((offs|
|000020f0| 65 74 20 3c 20 30 29 20 | 7c 7c 20 28 6f 66 66 73 |et < 0) ||| (offs|
|00002100| 65 74 20 3e 20 73 65 67 | 6d 65 6e 74 4c 65 6e 67 |et > seg|mentLeng|
|00002110| 74 68 29 29 0d 09 09 09 | 7b 0d 09 09 09 09 2f 2f |th))....|{.....//|
|00002120| 20 77 65 20 77 61 6e 74 | 20 74 68 65 20 74 6f 74 | we want| the tot|
|00002130| 61 6c 20 77 69 64 74 68 | 20 6f 66 20 74 68 69 73 |al width| of this|
|00002140| 20 73 65 67 6d 65 6e 74 | 2c 20 73 6f 20 73 65 74 | segment|, so set|
|00002150| 20 6f 66 66 73 65 74 20 | 61 6e 64 20 64 69 72 65 | offset |and dire|
|00002160| 63 74 69 6f 6e 20 61 70 | 70 72 6f 70 72 69 61 74 |ction ap|propriat|
|00002170| 65 6c 79 0d 09 09 09 09 | 69 66 20 28 73 65 67 6d |ely.....|if (segm|
|00002180| 65 6e 74 44 69 72 29 0d | 09 09 09 09 7b 0d 09 09 |entDir).|....{...|
|00002190| 09 09 09 6f 66 66 73 65 | 74 20 3d 20 30 3b 0d 09 |...offse|t = 0;..|
|000021a0| 09 09 09 09 64 69 72 65 | 63 74 69 6f 6e 20 3d 20 |....dire|ction = |
|000021b0| 72 69 67 68 74 43 61 72 | 65 74 3b 0d 09 09 09 09 |rightCar|et;.....|
|000021c0| 7d 0d 09 09 09 09 65 6c | 73 65 0d 09 09 09 09 7b |}.....el|se.....{|
|000021d0| 0d 09 09 09 09 09 6f 66 | 66 73 65 74 20 3d 20 73 |......of|fset = s|
|000021e0| 65 67 6d 65 6e 74 4c 65 | 6e 67 74 68 3b 0d 09 09 |egmentLe|ngth;...|
|000021f0| 09 09 09 64 69 72 65 63 | 74 69 6f 6e 20 3d 20 6c |...direc|tion = l|
|00002200| 65 66 74 43 61 72 65 74 | 3b 0d 09 09 09 09 7d 0d |eftCaret|;.....}.|
|00002210| 09 09 09 7d 0d 09 09 09 | 65 6c 73 65 20 69 66 20 |...}....|else if |
|00002220| 28 63 64 2d 3e 72 69 67 | 68 74 45 64 67 65 29 0d |(cd->rig|htEdge).|
|00002230| 09 09 09 7b 0d 09 09 09 | 09 2f 2f 20 77 65 27 72 |...{....|.// we'r|
|00002240| 65 20 64 72 61 77 69 6e | 67 20 61 20 63 75 72 73 |e drawin|g a curs|
|00002250| 6f 72 20 61 74 20 74 68 | 65 20 72 69 67 68 74 20 |or at th|e right |
|00002260| 65 64 67 65 20 6f 66 20 | 74 68 65 20 6c 69 6e 65 |edge of |the line|
|00002270| 2c 20 73 6f 20 65 6e 73 | 75 72 65 20 77 65 20 6d |, so ens|ure we m|
|00002280| 65 61 73 75 72 65 20 74 | 68 69 73 20 77 68 6f 6c |easure t|his whol|
|00002290| 65 20 73 65 67 6d 65 6e | 74 0d 09 09 09 09 69 73 |e segmen|t.....is|
|000022a0| 49 6e 53 65 67 6d 65 6e | 74 20 3d 20 66 61 6c 73 |InSegmen|t = fals|
|000022b0| 65 3b 0d 09 09 09 09 69 | 66 20 28 63 64 2d 3e 6c |e;.....i|f (cd->l|
|000022c0| 69 6e 65 44 69 72 20 26 | 26 20 21 73 65 67 6d 65 |ineDir &|& !segme|
|000022d0| 6e 74 44 69 72 29 0d 09 | 09 09 09 7b 0d 09 09 09 |ntDir)..|...{....|
|000022e0| 09 09 6f 66 66 73 65 74 | 20 3d 20 73 65 67 6d 65 |..offset| = segme|
|000022f0| 6e 74 4c 65 6e 67 74 68 | 3b 0d 09 09 09 09 09 64 |ntLength|;......d|
|00002300| 69 72 65 63 74 69 6f 6e | 20 3d 20 6c 65 66 74 43 |irection| = leftC|
|00002310| 61 72 65 74 3b 0d 09 09 | 09 09 7d 0d 09 09 09 09 |aret;...|..}.....|
|00002320| 65 6c 73 65 20 69 66 20 | 28 21 63 64 2d 3e 6c 69 |else if |(!cd->li|
|00002330| 6e 65 44 69 72 20 26 26 | 20 73 65 67 6d 65 6e 74 |neDir &&| segment|
|00002340| 44 69 72 29 0d 09 09 09 | 09 7b 0d 09 09 09 09 09 |Dir)....|.{......|
|00002350| 6f 66 66 73 65 74 20 3d | 20 30 3b 0d 09 09 09 09 |offset =| 0;.....|
|00002360| 09 64 69 72 65 63 74 69 | 6f 6e 20 3d 20 72 69 67 |.directi|on = rig|
|00002370| 68 74 43 61 72 65 74 3b | 0d 09 09 09 09 7d 0d 09 |htCaret;|.....}..|
|00002380| 09 09 7d 0d 09 09 09 65 | 6c 73 65 20 69 66 20 28 |..}....e|lse if (|
|00002390| 28 6f 66 66 73 65 74 20 | 3d 3d 20 30 29 20 7c 7c |(offset |== 0) |||
|000023a0| 20 28 6f 66 66 73 65 74 | 20 3d 3d 20 73 65 67 6d | (offset| == segm|
|000023b0| 65 6e 74 4c 65 6e 67 74 | 68 29 29 0d 09 09 09 7b |entLengt|h))....{|
|000023c0| 0d 09 09 09 09 69 73 49 | 6e 53 65 67 6d 65 6e 74 |.....isI|nSegment|
|000023d0| 20 3d 20 66 61 6c 73 65 | 3b 0d 09 09 09 09 2f 2f | = false|;.....//|
|000023e0| 20 77 65 27 72 65 20 61 | 74 20 61 20 73 74 79 6c | we're a|t a styl|
|000023f0| 65 20 72 75 6e 20 62 6f | 75 6e 64 61 72 79 0d 09 |e run bo|undary..|
|00002400| 09 09 09 69 66 20 28 28 | 28 64 69 72 65 63 74 69 |...if ((|(directi|
|00002410| 6f 6e 20 3d 3d 20 6c 65 | 66 74 43 61 72 65 74 29 |on == le|ftCaret)|
|00002420| 20 26 26 20 28 21 20 73 | 65 67 6d 65 6e 74 44 69 | && (! s|egmentDi|
|00002430| 72 29 29 20 7c 7c 20 28 | 28 64 69 72 65 63 74 69 |r)) || (|(directi|
|00002440| 6f 6e 20 3d 3d 20 72 69 | 67 68 74 43 61 72 65 74 |on == ri|ghtCaret|
|00002450| 29 20 26 26 20 73 65 67 | 6d 65 6e 74 44 69 72 29 |) && seg|mentDir)|
|00002460| 29 0d 09 09 09 09 7b 0d | 09 09 09 09 09 2f 2f 20 |).....{.|.....// |
|00002470| 72 65 71 75 65 73 74 65 | 64 20 63 61 72 65 74 20 |requeste|d caret |
|00002480| 64 69 72 65 63 74 69 6f | 6e 20 6d 61 74 63 68 65 |directio|n matche|
|00002490| 73 20 73 74 79 6c 65 20 | 72 75 6e 20 64 69 72 65 |s style |run dire|
|000024a0| 63 74 69 6f 6e 2c 20 73 | 6f 20 77 65 20 63 61 6e |ction, s|o we can|
|000024b0| 20 65 78 69 74 20 74 68 | 65 20 6c 6f 6f 70 0d 09 | exit th|e loop..|
|000024c0| 09 09 09 09 69 73 49 6e | 53 65 67 6d 65 6e 74 20 |....isIn|Segment |
|000024d0| 3d 20 74 72 75 65 3b 0d | 09 09 09 09 7d 0d 09 09 |= true;.|....}...|
|000024e0| 09 09 65 6c 73 65 0d 09 | 09 09 09 7b 0d 09 09 09 |..else..|...{....|
|000024f0| 09 09 2f 2f 20 6e 65 65 | 64 20 63 61 72 65 74 20 |..// nee|d caret |
|00002500| 66 6f 72 20 64 69 72 65 | 63 74 69 6f 6e 20 6f 70 |for dire|ction op|
|00002510| 70 6f 73 69 74 65 20 74 | 6f 20 74 68 69 73 20 72 |posite t|o this r|
|00002520| 75 6e 2c 20 73 6f 20 6e | 65 65 64 20 74 6f 20 63 |un, so n|eed to c|
|00002530| 68 65 63 6b 20 66 6f 72 | 20 64 69 72 65 63 74 69 |heck for| directi|
|00002540| 6f 6e 20 72 75 6e 20 62 | 6f 75 6e 64 61 72 79 3b |on run b|oundary;|
|00002550| 0d 09 09 09 09 09 2f 2f | 20 64 65 74 65 72 6d 69 |......//| determi|
|00002560| 6e 65 20 77 68 65 74 68 | 65 72 20 70 72 65 63 65 |ne wheth|er prece|
|00002570| 64 69 6e 67 20 61 6e 64 | 20 66 6f 6c 6c 6f 77 69 |ding and| followi|
|00002580| 6e 67 20 72 75 6e 73 20 | 61 72 65 20 52 2d 4c 0d |ng runs |are R-L.|
|00002590| 09 09 09 09 09 42 6f 6f | 6c 65 61 6e 20 70 72 65 |.....Boo|lean pre|
|000025a0| 76 44 69 72 3b 0d 09 09 | 09 09 09 42 6f 6f 6c 65 |vDir;...|...Boole|
|000025b0| 61 6e 20 6e 65 78 74 44 | 69 72 3b 0d 0d 09 09 09 |an nextD|ir;.....|
|000025c0| 09 09 2f 2f 09 6e 6f 74 | 65 20 74 68 61 74 20 69 |..//.not|e that i|
|000025d0| 66 20 73 65 67 6d 65 6e | 74 53 74 61 72 74 20 69 |f segmen|tStart i|
|000025e0| 73 20 30 2c 20 57 45 47 | 65 74 52 75 6e 44 69 72 |s 0, WEG|etRunDir|
|000025f0| 65 63 74 69 6f 6e 0d 09 | 09 09 09 09 2f 2f 09 77 |ection..|....//.w|
|00002600| 69 6c 6c 20 72 65 74 75 | 72 6e 20 74 68 65 20 70 |ill retu|rn the p|
|00002610| 72 69 6d 61 72 79 20 6c | 69 6e 65 20 64 69 72 65 |rimary l|ine dire|
|00002620| 63 74 69 6f 6e 0d 09 09 | 09 09 09 70 72 65 76 44 |ction...|...prevD|
|00002630| 69 72 20 3d 20 57 45 47 | 65 74 52 75 6e 44 69 72 |ir = WEG|etRunDir|
|00002640| 65 63 74 69 6f 6e 28 73 | 65 67 6d 65 6e 74 53 74 |ection(s|egmentSt|
|00002650| 61 72 74 20 2d 20 31 2c | 20 68 57 45 29 3b 0d 0d |art - 1,| hWE);..|
|00002660| 09 09 09 09 09 2f 2f 09 | 61 67 61 69 6e 2c 20 69 |.....//.|again, i|
|00002670| 66 20 73 65 67 6d 65 6e | 74 53 74 61 72 74 20 2b |f segmen|tStart +|
|00002680| 20 73 65 67 6d 65 6e 74 | 4c 65 6e 67 74 68 20 3d | segment|Length =|
|00002690| 3d 20 70 57 45 2d 3e 74 | 65 78 74 4c 65 6e 67 74 |= pWE->t|extLengt|
|000026a0| 68 2c 0d 09 09 09 09 09 | 2f 2f 09 57 45 47 65 74 |h,......|//.WEGet|
|000026b0| 52 75 6e 44 69 72 65 63 | 74 69 6f 6e 20 77 69 6c |RunDirec|tion wil|
|000026c0| 6c 20 64 6f 20 74 68 65 | 20 52 69 67 68 74 20 54 |l do the| Right T|
|000026d0| 68 69 6e 67 0d 09 09 09 | 09 09 6e 65 78 74 44 69 |hing....|..nextDi|
|000026e0| 72 20 3d 20 57 45 47 65 | 74 52 75 6e 44 69 72 65 |r = WEGe|tRunDire|
|000026f0| 63 74 69 6f 6e 28 73 65 | 67 6d 65 6e 74 53 74 61 |ction(se|gmentSta|
|00002700| 72 74 20 2b 20 73 65 67 | 6d 65 6e 74 4c 65 6e 67 |rt + seg|mentLeng|
|00002710| 74 68 2c 20 68 57 45 29 | 3b 0d 0d 09 09 09 09 09 |th, hWE)|;.......|
|00002720| 69 66 20 28 28 6f 66 66 | 73 65 74 20 3d 3d 20 30 |if ((off|set == 0|
|00002730| 29 20 26 26 20 28 70 72 | 65 76 44 69 72 20 21 3d |) && (pr|evDir !=|
|00002740| 20 73 65 67 6d 65 6e 74 | 44 69 72 29 29 0d 09 09 | segment|Dir))...|
|00002750| 09 09 09 7b 0d 09 09 09 | 09 09 09 69 66 20 28 63 |...{....|...if (c|
|00002760| 64 2d 3e 6c 69 6e 65 44 | 69 72 29 0d 09 09 09 09 |d->lineD|ir).....|
|00002770| 09 09 7b 0d 09 09 09 09 | 09 09 09 69 66 20 28 73 |..{.....|...if (s|
|00002780| 65 67 6d 65 6e 74 44 69 | 72 29 0d 09 09 09 09 09 |egmentDi|r)......|
|00002790| 09 09 7b 0d 09 09 09 09 | 09 09 09 09 2f 2f 6f 66 |..{.....|....//of|
|000027a0| 66 73 65 74 20 3d 20 30 | 3b 09 2f 2f 20 61 6c 72 |fset = 0|;.// alr|
|000027b0| 65 61 64 79 20 6b 6e 6f | 77 6e 20 74 6f 20 62 65 |eady kno|wn to be|
|000027c0| 20 7a 65 72 6f 0d 09 09 | 09 09 09 09 09 09 64 69 | zero...|......di|
|000027d0| 72 65 63 74 69 6f 6e 20 | 3d 20 72 69 67 68 74 43 |rection |= rightC|
|000027e0| 61 72 65 74 3b 0d 09 09 | 09 09 09 09 09 7d 0d 09 |aret;...|.....}..|
|000027f0| 09 09 09 09 09 09 65 6c | 73 65 0d 09 09 09 09 09 |......el|se......|
|00002800| 09 09 7b 0d 09 09 09 09 | 09 09 09 09 6f 66 66 73 |..{.....|....offs|
|00002810| 65 74 20 3d 20 73 65 67 | 6d 65 6e 74 4c 65 6e 67 |et = seg|mentLeng|
|00002820| 74 68 3b 0d 09 09 09 09 | 09 09 09 09 64 69 72 65 |th;.....|....dire|
|00002830| 63 74 69 6f 6e 20 3d 20 | 6c 65 66 74 43 61 72 65 |ction = |leftCare|
|00002840| 74 3b 0d 09 09 09 09 09 | 09 09 7d 0d 09 09 09 09 |t;......|..}.....|
|00002850| 09 09 7d 0d 09 09 09 09 | 09 7d 0d 09 09 09 09 09 |..}.....|.}......|
|00002860| 65 6c 73 65 20 69 66 20 | 28 28 6f 66 66 73 65 74 |else if |((offset|
|00002870| 20 3d 3d 20 73 65 67 6d | 65 6e 74 4c 65 6e 67 74 | == segm|entLengt|
|00002880| 68 29 20 26 26 20 28 6e | 65 78 74 44 69 72 20 21 |h) && (n|extDir !|
|00002890| 3d 20 73 65 67 6d 65 6e | 74 44 69 72 29 29 0d 09 |= segmen|tDir))..|
|000028a0| 09 09 09 09 7b 0d 09 09 | 09 09 09 09 69 66 20 28 |....{...|....if (|
|000028b0| 21 63 64 2d 3e 6c 69 6e | 65 44 69 72 29 0d 09 09 |!cd->lin|eDir)...|
|000028c0| 09 09 09 09 7b 0d 09 09 | 09 09 09 09 09 69 66 20 |....{...|.....if |
|000028d0| 28 73 65 67 6d 65 6e 74 | 44 69 72 29 0d 09 09 09 |(segment|Dir)....|
|000028e0| 09 09 09 09 7b 0d 09 09 | 09 09 09 09 09 09 6f 66 |....{...|......of|
|000028f0| 66 73 65 74 20 3d 20 30 | 3b 0d 09 09 09 09 09 09 |fset = 0|;.......|
|00002900| 09 09 64 69 72 65 63 74 | 69 6f 6e 20 3d 20 72 69 |..direct|ion = ri|
|00002910| 67 68 74 43 61 72 65 74 | 3b 0d 09 09 09 09 09 09 |ghtCaret|;.......|
|00002920| 09 7d 0d 09 09 09 09 09 | 09 09 65 6c 73 65 0d 09 |.}......|..else..|
|00002930| 09 09 09 09 09 09 7b 0d | 09 09 09 09 09 09 09 09 |......{.|........|
|00002940| 2f 2f 6f 66 66 73 65 74 | 20 3d 20 73 65 67 6d 65 |//offset| = segme|
|00002950| 6e 74 4c 65 6e 67 74 68 | 3b 0d 09 09 09 09 09 09 |ntLength|;.......|
|00002960| 09 09 64 69 72 65 63 74 | 69 6f 6e 20 3d 20 6c 65 |..direct|ion = le|
|00002970| 66 74 43 61 72 65 74 3b | 0d 09 09 09 09 09 09 09 |ftCaret;|........|
|00002980| 7d 0d 09 09 09 09 09 09 | 7d 0d 09 09 09 09 09 7d |}.......|}......}|
|00002990| 0d 09 09 09 09 09 65 6c | 73 65 0d 09 09 09 09 09 |......el|se......|
|000029a0| 7b 0d 09 09 09 09 09 09 | 2f 2f 20 6e 6f 74 20 61 |{.......|// not a|
|000029b0| 20 64 69 72 65 63 74 69 | 6f 6e 20 62 6f 75 6e 64 | directi|on bound|
|000029c0| 61 72 79 2c 20 73 6f 20 | 66 6f 72 63 65 20 63 61 |ary, so |force ca|
|000029d0| 72 65 74 20 64 69 72 20 | 74 6f 20 6d 61 74 63 68 |ret dir |to match|
|000029e0| 20 73 74 79 6c 65 20 72 | 75 6e 20 64 69 72 2c 20 | style r|un dir, |
|000029f0| 61 6e 64 20 65 78 69 74 | 20 6c 6f 6f 70 0d 09 09 |and exit| loop...|
|00002a00| 09 09 09 09 64 69 72 65 | 63 74 69 6f 6e 20 3d 20 |....dire|ction = |
|00002a10| 73 65 67 6d 65 6e 74 44 | 69 72 20 3f 20 72 69 67 |segmentD|ir ? rig|
|00002a20| 68 74 43 61 72 65 74 20 | 3a 20 6c 65 66 74 43 61 |htCaret |: leftCa|
|00002a30| 72 65 74 3b 0d 09 09 09 | 09 09 09 69 73 49 6e 53 |ret;....|...isInS|
|00002a40| 65 67 6d 65 6e 74 20 3d | 20 74 72 75 65 3b 0d 09 |egment =| true;..|
|00002a50| 09 09 09 09 7d 0d 09 09 | 09 09 7d 0d 09 09 09 7d |....}...|..}....}|
|00002a60| 0d 09 09 7d 20 2f 2f 20 | 65 6e 64 20 6f 66 20 73 |...} // |end of s|
|00002a70| 70 65 63 69 61 6c 20 74 | 72 65 61 74 6d 65 6e 74 |pecial t|reatment|
|00002a80| 20 66 6f 72 20 62 69 64 | 69 72 65 63 74 69 6f 6e | for bid|irection|
|00002a90| 61 6c 20 73 63 72 69 70 | 74 73 0d 0d 09 09 2f 2f |al scrip|ts....//|
|00002aa0| 20 63 61 6c 6c 20 43 68 | 61 72 54 6f 50 69 78 65 | call Ch|arToPixe|
|00002ab0| 6c 20 74 6f 20 67 65 74 | 20 77 69 64 74 68 20 6f |l to get| width o|
|00002ac0| 66 20 73 65 67 6d 65 6e | 74 20 75 70 20 74 6f 20 |f segmen|t up to |
|00002ad0| 73 70 65 63 69 66 69 65 | 64 20 6f 66 66 73 65 74 |specifie|d offset|
|00002ae0| 0d 09 09 77 69 64 74 68 | 20 3d 20 43 61 6c 6c 57 |...width| = CallW|
|00002af0| 45 43 68 61 72 54 6f 50 | 69 78 65 6c 50 72 6f 63 |ECharToP|ixelProc|
|00002b00| 28 70 53 65 67 6d 65 6e | 74 2c 20 73 65 67 6d 65 |(pSegmen|t, segme|
|00002b10| 6e 74 4c 65 6e 67 74 68 | 2c 0d 09 09 09 73 6c 6f |ntLength|,....slo|
|00002b20| 70 2c 20 6f 66 66 73 65 | 74 2c 20 64 69 72 65 63 |p, offse|t, direc|
|00002b30| 74 69 6f 6e 2c 20 73 74 | 79 6c 65 52 75 6e 50 6f |tion, st|yleRunPo|
|00002b40| 73 69 74 69 6f 6e 2c 20 | 63 64 2d 3e 74 68 65 50 |sition, |cd->theP|
|00002b50| 6f 69 6e 74 2d 3e 68 2c | 0d 09 09 09 68 57 45 2c |oint->h,|....hWE,|
|00002b60| 20 70 57 45 2d 3e 63 68 | 61 72 54 6f 50 69 78 65 | pWE->ch|arToPixe|
|00002b70| 6c 48 6f 6f 6b 29 3b 0d | 09 7d 0d 0d 09 2f 2f 20 |lHook);.|.}...// |
|00002b80| 61 64 76 61 6e 63 65 20 | 74 68 65 50 6f 69 6e 74 |advance |thePoint|
|00002b90| 2e 68 20 62 79 20 74 68 | 65 20 77 69 64 74 68 20 |.h by th|e width |
|00002ba0| 6f 66 20 74 68 69 73 20 | 73 65 67 6d 65 6e 74 0d |of this |segment.|
|00002bb0| 09 63 64 2d 3e 74 68 65 | 50 6f 69 6e 74 2d 3e 68 |.cd->the|Point->h|
|00002bc0| 20 2b 3d 20 77 69 64 74 | 68 3b 0d 0d 09 2f 2f 20 | += widt|h;...// |
|00002bd0| 64 72 6f 70 20 6f 75 74 | 20 6f 66 20 6c 6f 6f 70 |drop out| of loop|
|00002be0| 20 77 68 65 6e 20 77 65 | 20 72 65 61 63 68 20 6f | when we| reach o|
|00002bf0| 66 66 73 65 74 0d 09 72 | 65 74 75 72 6e 20 69 73 |ffset..r|eturn is|
|00002c00| 49 6e 53 65 67 6d 65 6e | 74 3b 0d 7d 0d 0d 70 61 |InSegmen|t;.}..pa|
|00002c10| 73 63 61 6c 20 76 6f 69 | 64 20 57 45 47 65 74 50 |scal voi|d WEGetP|
|00002c20| 6f 69 6e 74 28 53 49 6e | 74 33 32 20 6f 66 66 73 |oint(SIn|t32 offs|
|00002c30| 65 74 2c 20 53 49 6e 74 | 31 36 20 64 69 72 65 63 |et, SInt|16 direc|
|00002c40| 74 69 6f 6e 2c 20 4c 6f | 6e 67 50 74 20 2a 74 68 |tion, Lo|ngPt *th|
|00002c50| 65 50 6f 69 6e 74 2c 20 | 53 49 6e 74 31 36 20 2a |ePoint, |SInt16 *|
|00002c60| 6c 69 6e 65 48 65 69 67 | 68 74 2c 20 57 45 48 61 |lineHeig|ht, WEHa|
|00002c70| 6e 64 6c 65 20 68 57 45 | 29 0d 7b 0d 09 2f 2f 20 |ndle hWE|).{..// |
|00002c80| 67 69 76 65 6e 20 61 20 | 62 79 74 65 20 6f 66 66 |given a |byte off|
|00002c90| 73 65 74 20 69 6e 74 6f | 20 74 68 65 20 74 65 78 |set into| the tex|
|00002ca0| 74 2c 20 66 69 6e 64 20 | 74 68 65 20 63 6f 72 72 |t, find |the corr|
|00002cb0| 65 73 70 6f 6e 64 69 6e | 67 20 67 6c 79 70 68 20 |espondin|g glyph |
|00002cc0| 70 6f 73 69 74 69 6f 6e | 0d 09 2f 2f 20 74 68 69 |position|..// thi|
|00002cd0| 73 20 72 6f 75 74 69 6e | 65 20 69 73 20 75 73 65 |s routin|e is use|
|00002ce0| 66 75 6c 20 66 6f 72 20 | 68 69 67 68 6c 69 67 68 |ful for |highligh|
|00002cf0| 74 69 6e 67 20 74 68 65 | 20 74 65 78 74 20 61 6e |ting the| text an|
|00002d00| 64 20 66 6f 72 20 70 6f | 73 69 74 69 6f 6e 69 6e |d for po|sitionin|
|00002d10| 67 20 74 68 65 20 63 61 | 72 65 74 0d 0d 09 57 45 |g the ca|ret...WE|
|00002d20| 50 74 72 20 70 57 45 3b | 0d 09 57 45 4c 69 6e 65 |Ptr pWE;|..WELine|
|00002d30| 52 65 63 20 2a 70 4c 69 | 6e 65 3b 0d 09 53 49 6e |Rec *pLi|ne;..SIn|
|00002d40| 74 33 32 20 6c 69 6e 65 | 49 6e 64 65 78 3b 0d 09 |t32 line|Index;..|
|00002d50| 53 49 6e 74 33 32 20 68 | 65 69 67 68 74 3b 0d 09 |SInt32 h|eight;..|
|00002d60| 73 74 72 75 63 74 20 53 | 4c 43 68 61 72 54 6f 50 |struct S|LCharToP|
|00002d70| 69 78 65 6c 44 61 74 61 | 20 63 64 3b 0d 09 42 6f |ixelData| cd;..Bo|
|00002d80| 6f 6c 65 61 6e 20 73 61 | 76 65 57 45 4c 6f 63 6b |olean sa|veWELock|
|00002d90| 3b 0d 0d 09 2f 2f 20 6c | 6f 63 6b 20 74 68 65 20 |;...// l|ock the |
|00002da0| 57 45 20 72 65 63 6f 72 | 64 0d 09 73 61 76 65 57 |WE recor|d..saveW|
|00002db0| 45 4c 6f 63 6b 20 3d 20 | 5f 57 45 53 65 74 48 61 |ELock = |_WESetHa|
|00002dc0| 6e 64 6c 65 4c 6f 63 6b | 28 28 48 61 6e 64 6c 65 |ndleLock|((Handle|
|00002dd0| 29 20 68 57 45 2c 20 74 | 72 75 65 29 3b 0d 09 70 |) hWE, t|rue);..p|
|00002de0| 57 45 20 3d 20 2a 68 57 | 45 3b 0d 0d 09 2f 2f 20 |WE = *hW|E;...// |
|00002df0| 74 68 65 20 62 61 73 65 | 20 70 6f 69 6e 74 20 69 |the base| point i|
|00002e00| 73 20 74 68 65 20 74 6f | 70 20 6c 65 66 74 20 63 |s the to|p left c|
|00002e10| 6f 72 6e 65 72 20 6f 66 | 20 74 68 65 20 64 65 73 |orner of| the des|
|00002e20| 74 69 6e 61 74 69 6f 6e | 20 72 65 63 74 61 6e 67 |tination| rectang|
|00002e30| 6c 65 0d 09 2a 74 68 65 | 50 6f 69 6e 74 20 3d 20 |le..*the|Point = |
|00002e40| 2a 20 28 4c 6f 6e 67 50 | 74 20 2a 29 20 26 70 57 |* (LongP|t *) &pW|
|00002e50| 45 2d 3e 64 65 73 74 52 | 65 63 74 3b 0d 0d 09 2f |E->destR|ect;.../|
|00002e60| 2f 20 66 69 72 73 74 20 | 6f 66 20 61 6c 6c 20 66 |/ first |of all f|
|00002e70| 69 6e 64 20 74 68 65 20 | 6c 69 6e 65 20 6f 6e 20 |ind the |line on |
|00002e80| 77 68 69 63 68 20 74 68 | 65 20 67 6c 79 70 68 20 |which th|e glyph |
|00002e90| 6c 69 65 73 0d 09 6c 69 | 6e 65 49 6e 64 65 78 20 |lies..li|neIndex |
|00002ea0| 3d 20 57 45 4f 66 66 73 | 65 74 54 6f 4c 69 6e 65 |= WEOffs|etToLine|
|00002eb0| 28 6f 66 66 73 65 74 2c | 20 68 57 45 29 3b 0d 0d |(offset,| hWE);..|
|00002ec0| 09 2f 2f 20 63 61 6c 63 | 75 6c 61 74 65 20 74 68 |.// calc|ulate th|
|00002ed0| 65 20 76 65 72 74 69 63 | 61 6c 20 63 6f 6f 72 64 |e vertic|al coord|
|00002ee0| 69 6e 61 74 65 20 61 6e | 64 20 74 68 65 20 6c 69 |inate an|d the li|
|00002ef0| 6e 65 20 68 65 69 67 68 | 74 0d 09 70 4c 69 6e 65 |ne heigh|t..pLine|
|00002f00| 20 3d 20 2a 70 57 45 2d | 3e 68 4c 69 6e 65 73 20 | = *pWE-|>hLines |
|00002f10| 2b 20 6c 69 6e 65 49 6e | 64 65 78 3b 0d 09 74 68 |+ lineIn|dex;..th|
|00002f20| 65 50 6f 69 6e 74 2d 3e | 76 20 2b 3d 20 70 4c 69 |ePoint->|v += pLi|
|00002f30| 6e 65 2d 3e 6c 69 6e 65 | 4f 72 69 67 69 6e 3b 0d |ne->line|Origin;.|
|00002f40| 09 68 65 69 67 68 74 20 | 3d 20 70 4c 69 6e 65 5b |.height |= pLine[|
|00002f50| 31 5d 2e 6c 69 6e 65 4f | 72 69 67 69 6e 20 2d 20 |1].lineO|rigin - |
|00002f60| 70 4c 69 6e 65 5b 30 5d | 2e 6c 69 6e 65 4f 72 69 |pLine[0]|.lineOri|
|00002f70| 67 69 6e 3b 0d 0d 09 69 | 66 20 28 28 6f 66 66 73 |gin;...i|f ((offs|
|00002f80| 65 74 20 3d 3d 20 70 57 | 45 2d 3e 74 65 78 74 4c |et == pW|E->textL|
|00002f90| 65 6e 67 74 68 29 20 26 | 26 20 28 57 45 47 65 74 |ength) &|& (WEGet|
|00002fa0| 43 68 61 72 28 6f 66 66 | 73 65 74 20 2d 20 31 2c |Char(off|set - 1,|
|00002fb0| 20 68 57 45 29 20 3d 3d | 20 6b 45 4f 4c 29 29 0d | hWE) ==| kEOL)).|
|00002fc0| 09 7b 0d 09 09 2f 2f 20 | 53 50 45 43 49 41 4c 20 |.{...// |SPECIAL |
|00002fd0| 43 41 53 45 3a 20 69 66 | 20 6f 66 66 73 65 74 20 |CASE: if| offset |
|00002fe0| 69 73 20 70 61 73 74 20 | 74 68 65 20 6c 61 73 74 |is past |the last|
|00002ff0| 20 63 68 61 72 61 63 74 | 65 72 20 61 6e 64 0d 09 | charact|er and..|
|00003000| 09 2f 2f 20 74 68 65 20 | 6c 61 73 74 20 63 68 61 |.// the |last cha|
|00003010| 72 61 63 74 65 72 20 69 | 73 20 61 20 63 61 72 72 |racter i|s a carr|
|00003020| 69 61 67 65 20 72 65 74 | 75 72 6e 2c 20 72 65 74 |iage ret|urn, ret|
|00003030| 75 72 6e 20 61 20 70 6f | 69 6e 74 20 62 65 6c 6f |urn a po|int belo|
|00003040| 77 20 74 68 65 20 6c 61 | 73 74 20 6c 69 6e 65 0d |w the la|st line.|
|00003050| 09 09 57 45 4c 69 6e 65 | 52 65 63 20 64 75 6d 6d |..WELine|Rec dumm|
|00003060| 79 4c 69 6e 65 3b 0d 0d | 09 09 64 75 6d 6d 79 4c |yLine;..|..dummyL|
|00003070| 69 6e 65 2e 6c 69 6e 65 | 53 6c 6f 70 20 3d 20 70 |ine.line|Slop = p|
|00003080| 57 45 2d 3e 64 65 73 74 | 52 65 63 74 2e 72 69 67 |WE->dest|Rect.rig|
|00003090| 68 74 20 2d 20 70 57 45 | 2d 3e 64 65 73 74 52 65 |ht - pWE|->destRe|
|000030a0| 63 74 2e 6c 65 66 74 3b | 0d 09 09 64 75 6d 6d 79 |ct.left;|...dummy|
|000030b0| 4c 69 6e 65 2e 6c 69 6e | 65 4a 75 73 74 41 6d 6f |Line.lin|eJustAmo|
|000030c0| 75 6e 74 20 3d 20 30 3b | 0d 0d 09 09 74 68 65 50 |unt = 0;|....theP|
|000030d0| 6f 69 6e 74 2d 3e 76 20 | 2b 3d 20 68 65 69 67 68 |oint->v |+= heigh|
|000030e0| 74 3b 0d 09 09 74 68 65 | 50 6f 69 6e 74 2d 3e 68 |t;...the|Point->h|
|000030f0| 20 2b 3d 20 5f 57 45 43 | 61 6c 63 50 65 6e 49 6e | += _WEC|alcPenIn|
|00003100| 64 65 6e 74 28 26 64 75 | 6d 6d 79 4c 69 6e 65 2c |dent(&du|mmyLine,|
|00003110| 20 70 57 45 2d 3e 61 6c | 69 67 6e 6d 65 6e 74 2c | pWE->al|ignment,|
|00003120| 20 70 57 45 2d 3e 64 69 | 72 65 63 74 69 6f 6e 29 | pWE->di|rection)|
|00003130| 3b 0d 09 7d 0d 09 65 6c | 73 65 0d 09 7b 0d 2f 2f |;..}..el|se..{.//|
|00003140| 20 a5 a5 a5 ca 6e 65 77 | 20 76 65 72 73 69 6f 6e | ....new| version|
|00003150| 20 6f 66 20 74 68 69 73 | 3a 20 62 65 74 74 65 72 | of this|: better|
|00003160| 20 62 6f 75 6e 64 61 72 | 79 20 62 65 68 61 76 69 | boundar|y behavi|
|00003170| 6f 72 0d 09 09 53 49 6e | 74 33 32 09 6c 69 6e 65 |or...SIn|t32.line|
|00003180| 53 74 61 72 74 2c 20 6c | 69 6e 65 45 6e 64 3b 0d |Start, l|ineEnd;.|
|00003190| 09 09 42 6f 6f 6c 65 61 | 6e 09 6c 69 6e 65 44 69 |..Boolea|n.lineDi|
|000031a0| 72 3b 0d 0d 09 09 2f 2f | 20 64 65 74 65 72 6d 69 |r;....//| determi|
|000031b0| 6e 65 20 74 68 65 20 64 | 6f 6d 69 6e 61 6e 74 20 |ne the d|ominant |
|000031c0| 6c 69 6e 65 20 64 69 72 | 65 63 74 69 6f 6e 0d 09 |line dir|ection..|
|000031d0| 09 6c 69 6e 65 44 69 72 | 20 3d 20 49 73 52 69 67 |.lineDir| = IsRig|
|000031e0| 68 74 54 6f 4c 65 66 74 | 28 70 57 45 2d 3e 64 69 |htToLeft|(pWE->di|
|000031f0| 72 65 63 74 69 6f 6e 29 | 3b 0d 0d 09 09 2f 2f 20 |rection)|;....// |
|00003200| 73 69 6d 70 6c 69 66 79 | 20 64 69 72 65 63 74 69 |simplify| directi|
|00003210| 6f 6e 20 73 6f 20 69 74 | 27 73 20 65 69 74 68 65 |on so it|'s eithe|
|00003220| 72 20 6c 65 66 74 43 61 | 72 65 74 20 6f 72 20 72 |r leftCa|ret or r|
|00003230| 69 67 68 74 43 61 72 65 | 74 0d 09 09 69 66 20 28 |ightCare|t...if (|
|00003240| 64 69 72 65 63 74 69 6f | 6e 20 3d 3d 20 68 69 6c |directio|n == hil|
|00003250| 69 74 65 29 0d 09 09 7b | 0d 09 09 09 64 69 72 65 |ite)...{|....dire|
|00003260| 63 74 69 6f 6e 20 3d 20 | 28 6c 69 6e 65 44 69 72 |ction = |(lineDir|
|00003270| 20 3f 20 72 69 67 68 74 | 43 61 72 65 74 20 3a 20 | ? right|Caret : |
|00003280| 6c 65 66 74 43 61 72 65 | 74 29 3b 0d 09 09 7d 0d |leftCare|t);...}.|
|00003290| 0d 09 09 2f 2f 20 66 69 | 6e 64 20 65 6e 64 73 20 |...// fi|nd ends |
|000032a0| 6f 66 20 6c 69 6e 65 20 | 73 6f 20 77 65 20 63 61 |of line |so we ca|
|000032b0| 6e 20 73 70 65 63 69 61 | 6c 2d 63 61 73 65 20 74 |n specia|l-case t|
|000032c0| 68 65 6d 0d 09 09 57 45 | 47 65 74 4c 69 6e 65 52 |hem...WE|GetLineR|
|000032d0| 61 6e 67 65 28 6c 69 6e | 65 49 6e 64 65 78 2c 20 |ange(lin|eIndex, |
|000032e0| 26 6c 69 6e 65 53 74 61 | 72 74 2c 20 26 6c 69 6e |&lineSta|rt, &lin|
|000032f0| 65 45 6e 64 2c 20 68 57 | 45 29 3b 0d 09 09 69 66 |eEnd, hW|E);...if|
|00003300| 20 28 6c 69 6e 65 45 6e | 64 20 3c 20 70 57 45 2d | (lineEn|d < pWE-|
|00003310| 3e 74 65 78 74 4c 65 6e | 67 74 68 20 7c 7c 20 57 |>textLen|gth || W|
|00003320| 45 47 65 74 43 68 61 72 | 28 6c 69 6e 65 45 6e 64 |EGetChar|(lineEnd|
|00003330| 20 2d 20 31 2c 20 68 57 | 45 29 20 3d 3d 20 6b 45 | - 1, hW|E) == kE|
|00003340| 4f 4c 29 0d 09 09 7b 0d | 09 09 09 2d 2d 6c 69 6e |OL)...{.|...--lin|
|00003350| 65 45 6e 64 3b 0d 09 09 | 7d 0d 0d 09 09 69 66 20 |eEnd;...|}....if |
|00003360| 28 28 6f 66 66 73 65 74 | 20 3d 3d 20 6c 69 6e 65 |((offset| == line|
|00003370| 53 74 61 72 74 20 26 26 | 20 21 6c 69 6e 65 44 69 |Start &&| !lineDi|
|00003380| 72 20 26 26 20 64 69 72 | 65 63 74 69 6f 6e 20 3d |r && dir|ection =|
|00003390| 3d 20 6c 65 66 74 43 61 | 72 65 74 29 0d 09 09 09 |= leftCa|ret)....|
|000033a0| 7c 7c 20 28 6f 66 66 73 | 65 74 20 3d 3d 20 6c 69 ||| (offs|et == li|
|000033b0| 6e 65 45 6e 64 20 26 26 | 20 6c 69 6e 65 44 69 72 |neEnd &&| lineDir|
|000033c0| 20 26 26 20 64 69 72 65 | 63 74 69 6f 6e 20 3d 3d | && dire|ction ==|
|000033d0| 20 72 69 67 68 74 43 61 | 72 65 74 29 0d 09 09 20 | rightCa|ret)... |
|000033e0| 20 20 29 0d 09 09 7b 0d | 09 09 09 2f 2f 20 53 50 | )...{.|...// SP|
|000033f0| 45 43 49 41 4c 20 43 41 | 53 45 3a 20 69 66 20 63 |ECIAL CA|SE: if c|
|00003400| 61 72 65 74 20 73 68 6f | 75 6c 64 20 62 65 20 61 |aret sho|uld be a|
|00003410| 74 20 6c 65 66 74 20 65 | 6e 64 20 6f 66 20 6c 69 |t left e|nd of li|
|00003420| 6e 65 2c 20 64 6f 6e 27 | 74 20 63 61 6c 6c 20 73 |ne, don'|t call s|
|00003430| 74 79 6c 65 20 72 75 6e | 20 6c 6f 6f 70 0d 09 09 |tyle run| loop...|
|00003440| 09 74 68 65 50 6f 69 6e | 74 2d 3e 68 20 2b 3d 20 |.thePoin|t->h += |
|00003450| 5f 57 45 43 61 6c 63 50 | 65 6e 49 6e 64 65 6e 74 |_WECalcP|enIndent|
|00003460| 28 70 4c 69 6e 65 2c 20 | 70 57 45 2d 3e 61 6c 69 |(pLine, |pWE->ali|
|00003470| 67 6e 6d 65 6e 74 2c 20 | 70 57 45 2d 3e 64 69 72 |gnment, |pWE->dir|
|00003480| 65 63 74 69 6f 6e 29 3b | 0d 09 09 7d 0d 09 09 65 |ection);|...}...e|
|00003490| 6c 73 65 0d 09 09 7b 0d | 09 09 09 63 64 2e 6c 69 |lse...{.|...cd.li|
|000034a0| 6e 65 44 69 72 20 3d 20 | 6c 69 6e 65 44 69 72 3b |neDir = |lineDir;|
|000034b0| 0d 09 09 09 2f 2f 20 49 | 6e 66 6f 72 6d 20 53 4c |....// I|nform SL|
|000034c0| 43 68 61 72 54 6f 50 69 | 78 65 6c 20 69 66 20 77 |CharToPi|xel if w|
|000034d0| 65 20 77 61 6e 74 20 74 | 68 65 20 72 69 67 68 74 |e want t|he right|
|000034e0| 20 65 64 67 65 20 6f 66 | 20 74 68 65 20 6c 69 6e | edge of| the lin|
|000034f0| 65 0d 09 09 09 63 64 2e | 72 69 67 68 74 45 64 67 |e....cd.|rightEdg|
|00003500| 65 20 3d 20 28 28 6f 66 | 66 73 65 74 20 3d 3d 20 |e = ((of|fset == |
|00003510| 6c 69 6e 65 45 6e 64 20 | 26 26 20 21 6c 69 6e 65 |lineEnd |&& !line|
|00003520| 44 69 72 20 26 26 20 64 | 69 72 65 63 74 69 6f 6e |Dir && d|irection|
|00003530| 20 3d 3d 20 6c 65 66 74 | 43 61 72 65 74 29 20 7c | == left|Caret) ||
|00003540| 7c 0d 09 09 09 09 09 09 | 09 28 6f 66 66 73 65 74 ||.......|.(offset|
|00003550| 20 3d 3d 20 6c 69 6e 65 | 53 74 61 72 74 20 26 26 | == line|Start &&|
|00003560| 20 6c 69 6e 65 44 69 72 | 20 26 26 20 64 69 72 65 | lineDir| && dire|
|00003570| 63 74 69 6f 6e 20 3d 3d | 20 72 69 67 68 74 43 61 |ction ==| rightCa|
|00003580| 72 65 74 29 29 3b 0d 09 | 09 09 63 64 2e 6f 66 66 |ret));..|..cd.off|
|00003590| 73 65 74 20 3d 20 6f 66 | 66 73 65 74 3b 0d 09 09 |set = of|fset;...|
|000035a0| 09 63 64 2e 74 68 65 50 | 6f 69 6e 74 20 3d 20 74 |.cd.theP|oint = t|
|000035b0| 68 65 50 6f 69 6e 74 3b | 0d 09 09 09 63 64 2e 64 |hePoint;|....cd.d|
|000035c0| 69 72 65 63 74 69 6f 6e | 20 3d 20 64 69 72 65 63 |irection| = direc|
|000035d0| 74 69 6f 6e 3b 0d 0d 09 | 09 09 2f 2f 20 74 6f 20 |tion;...|..// to |
|000035e0| 67 65 74 20 74 68 65 20 | 68 6f 72 69 7a 6f 6e 74 |get the |horizont|
|000035f0| 61 6c 20 63 6f 6f 72 64 | 69 6e 61 74 65 2c 20 77 |al coord|inate, w|
|00003600| 61 6c 6b 20 74 68 72 6f | 75 67 68 20 74 68 65 20 |alk thro|ugh the |
|00003610| 73 74 79 6c 65 20 72 75 | 6e 73 20 6f 6e 20 74 68 |style ru|ns on th|
|00003620| 69 73 20 6c 69 6e 65 0d | 09 09 09 5f 57 45 53 65 |is line.|..._WESe|
|00003630| 67 6d 65 6e 74 4c 6f 6f | 70 28 6c 69 6e 65 49 6e |gmentLoo|p(lineIn|
|00003640| 64 65 78 2c 20 6c 69 6e | 65 49 6e 64 65 78 2c 20 |dex, lin|eIndex, |
|00003650| 53 4c 43 68 61 72 54 6f | 50 69 78 65 6c 2c 20 26 |SLCharTo|Pixel, &|
|00003660| 63 64 2c 20 68 57 45 29 | 3b 0d 09 09 7d 0d 0d 2f |cd, hWE)|;...}../|
|00003670| 2f 20 a5 a5 a5 ca 72 65 | 70 6c 61 63 65 64 20 77 |/ ....re|placed w|
|00003680| 69 74 68 20 63 6f 64 65 | 20 61 62 6f 76 65 0d 2f |ith code| above./|
|00003690| 2a 0d 09 09 63 64 2e 6f | 66 66 73 65 74 20 3d 20 |*...cd.o|ffset = |
|000036a0| 6f 66 66 73 65 74 3b 0d | 09 09 63 64 2e 74 68 65 |offset;.|..cd.the|
|000036b0| 50 6f 69 6e 74 20 3d 20 | 74 68 65 50 6f 69 6e 74 |Point = |thePoint|
|000036c0| 3b 0d 09 09 63 64 2e 64 | 69 72 65 63 74 69 6f 6e |;...cd.d|irection|
|000036d0| 20 3d 20 64 69 72 65 63 | 74 69 6f 6e 3b 0d 0d 09 | = direc|tion;...|
|000036e0| 09 2f 2f 20 74 6f 20 67 | 65 74 20 74 68 65 20 68 |.// to g|et the h|
|000036f0| 6f 72 69 7a 6f 6e 74 61 | 6c 20 63 6f 6f 72 64 69 |orizonta|l coordi|
|00003700| 6e 61 74 65 2c 20 77 61 | 6c 6b 20 74 68 72 6f 75 |nate, wa|lk throu|
|00003710| 67 68 20 74 68 65 20 73 | 74 79 6c 65 20 72 75 6e |gh the s|tyle run|
|00003720| 73 20 6f 6e 20 74 68 69 | 73 20 6c 69 6e 65 0d 09 |s on thi|s line..|
|00003730| 09 5f 57 45 53 65 67 6d | 65 6e 74 4c 6f 6f 70 28 |._WESegm|entLoop(|
|00003740| 6c 69 6e 65 49 6e 64 65 | 78 2c 20 6c 69 6e 65 49 |lineInde|x, lineI|
|00003750| 6e 64 65 78 2c 20 53 4c | 43 68 61 72 54 6f 50 69 |ndex, SL|CharToPi|
|00003760| 78 65 6c 2c 20 26 63 64 | 2c 20 68 57 45 29 3b 0d |xel, &cd|, hWE);.|
|00003770| 2a 2f 0d 09 7d 0d 0d 09 | 2f 2f 20 70 69 6e 20 74 |*/..}...|// pin t|
|00003780| 68 65 20 68 6f 72 69 7a | 6f 6e 74 61 6c 20 63 6f |he horiz|ontal co|
|00003790| 6f 72 64 69 6e 61 74 65 | 20 74 6f 20 74 68 65 20 |ordinate| to the |
|000037a0| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 72 65 63 74 |destinat|ion rect|
|000037b0| 61 6e 67 6c 65 0d 09 74 | 68 65 50 6f 69 6e 74 2d |angle..t|hePoint-|
|000037c0| 3e 68 20 3d 20 5f 57 45 | 50 69 6e 49 6e 52 61 6e |>h = _WE|PinInRan|
|000037d0| 67 65 28 74 68 65 50 6f | 69 6e 74 2d 3e 68 2c 20 |ge(thePo|int->h, |
|000037e0| 70 57 45 2d 3e 64 65 73 | 74 52 65 63 74 2e 6c 65 |pWE->des|tRect.le|
|000037f0| 66 74 2c 20 70 57 45 2d | 3e 64 65 73 74 52 65 63 |ft, pWE-|>destRec|
|00003800| 74 2e 72 69 67 68 74 29 | 3b 0d 0d 09 2f 2f 20 75 |t.right)|;...// u|
|00003810| 6e 6c 6f 63 6b 20 74 68 | 65 20 57 45 20 72 65 63 |nlock th|e WE rec|
|00003820| 6f 72 64 0d 09 5f 57 45 | 53 65 74 48 61 6e 64 6c |ord.._WE|SetHandl|
|00003830| 65 4c 6f 63 6b 28 28 48 | 61 6e 64 6c 65 29 20 68 |eLock((H|andle) h|
|00003840| 57 45 2c 20 73 61 76 65 | 57 45 4c 6f 63 6b 29 3b |WE, save|WELock);|
|00003850| 0d 0d 09 2f 2f 20 63 6f | 70 79 20 6c 69 6e 65 20 |...// co|py line |
|00003860| 68 65 69 67 68 74 0d 09 | 69 66 20 28 6c 69 6e 65 |height..|if (line|
|00003870| 48 65 69 67 68 74 20 21 | 3d 20 6e 69 6c 29 0d 09 |Height !|= nil)..|
|00003880| 7b 0d 09 09 2a 6c 69 6e | 65 48 65 69 67 68 74 20 |{...*lin|eHeight |
|00003890| 3d 20 68 65 69 67 68 74 | 3b 0d 09 7d 0d 7d 0d 0d |= height|;..}.}..|
|000038a0| 70 61 73 63 61 6c 20 76 | 6f 69 64 20 57 45 46 69 |pascal v|oid WEFi|
|000038b0| 6e 64 4c 69 6e 65 28 53 | 49 6e 74 33 32 20 6f 66 |ndLine(S|Int32 of|
|000038c0| 66 73 65 74 2c 20 57 45 | 45 64 67 65 20 65 64 67 |fset, WE|Edge edg|
|000038d0| 65 2c 20 53 49 6e 74 33 | 32 20 2a 6c 69 6e 65 53 |e, SInt3|2 *lineS|
|000038e0| 74 61 72 74 2c 20 53 49 | 6e 74 33 32 20 2a 6c 69 |tart, SI|nt32 *li|
|000038f0| 6e 65 45 6e 64 2c 20 57 | 45 48 61 6e 64 6c 65 20 |neEnd, W|EHandle |
|00003900| 68 57 45 29 0d 7b 0d 23 | 70 72 61 67 6d 61 20 75 |hWE).{.#|pragma u|
|00003910| 6e 75 73 65 64 28 65 64 | 67 65 29 0d 09 57 45 50 |nused(ed|ge)..WEP|
|00003920| 74 72 20 70 57 45 20 3d | 20 2a 68 57 45 3b 0d 09 |tr pWE =| *hWE;..|
|00003930| 57 45 4c 69 6e 65 52 65 | 63 20 2a 70 4c 69 6e 65 |WELineRe|c *pLine|
|00003940| 3b 0d 0d 09 70 4c 69 6e | 65 20 3d 20 2a 70 57 45 |;...pLin|e = *pWE|
|00003950| 2d 3e 68 4c 69 6e 65 73 | 20 2b 20 57 45 4f 66 66 |->hLines| + WEOff|
|00003960| 73 65 74 54 6f 4c 69 6e | 65 28 6f 66 66 73 65 74 |setToLin|e(offset|
|00003970| 2c 20 68 57 45 29 3b 0d | 09 69 66 20 28 6c 69 6e |, hWE);.|.if (lin|
|00003980| 65 53 74 61 72 74 20 21 | 3d 20 6e 69 6c 29 0d 09 |eStart !|= nil)..|
|00003990| 7b 0d 09 09 2a 6c 69 6e | 65 53 74 61 72 74 20 3d |{...*lin|eStart =|
|000039a0| 20 70 4c 69 6e 65 5b 30 | 5d 2e 6c 69 6e 65 53 74 | pLine[0|].lineSt|
|000039b0| 61 72 74 3b 0d 09 7d 0d | 09 69 66 20 28 6c 69 6e |art;..}.|.if (lin|
|000039c0| 65 45 6e 64 20 21 3d 20 | 6e 69 6c 29 0d 09 7b 0d |eEnd != |nil)..{.|
|000039d0| 09 09 2a 6c 69 6e 65 45 | 6e 64 20 3d 20 70 4c 69 |..*lineE|nd = pLi|
|000039e0| 6e 65 5b 31 5d 2e 6c 69 | 6e 65 53 74 61 72 74 3b |ne[1].li|neStart;|
|000039f0| 0d 09 7d 0d 7d 0d 0d 70 | 61 73 63 61 6c 20 76 6f |..}.}..p|ascal vo|
|00003a00| 69 64 20 57 45 46 69 6e | 64 50 61 72 61 67 72 61 |id WEFin|dParagra|
|00003a10| 70 68 28 53 49 6e 74 33 | 32 20 6f 66 66 73 65 74 |ph(SInt3|2 offset|
|00003a20| 2c 20 57 45 45 64 67 65 | 20 65 64 67 65 2c 20 53 |, WEEdge| edge, S|
|00003a30| 49 6e 74 33 32 20 2a 70 | 61 72 61 67 72 61 70 68 |Int32 *p|aragraph|
|00003a40| 53 74 61 72 74 2c 20 53 | 49 6e 74 33 32 20 2a 70 |Start, S|Int32 *p|
|00003a50| 61 72 61 67 72 61 70 68 | 45 6e 64 2c 20 57 45 48 |aragraph|End, WEH|
|00003a60| 61 6e 64 6c 65 20 68 57 | 45 29 0d 7b 0d 23 70 72 |andle hW|E).{.#pr|
|00003a70| 61 67 6d 61 20 75 6e 75 | 73 65 64 28 65 64 67 65 |agma unu|sed(edge|
|00003a80| 29 0d 09 57 45 50 74 72 | 20 70 57 45 20 3d 20 2a |)..WEPtr| pWE = *|
|00003a90| 20 68 57 45 20 3b 0d 09 | 50 74 72 20 70 54 65 78 | hWE ;..|Ptr pTex|
|00003aa0| 74 20 3d 20 2a 20 70 57 | 45 20 2d 3e 20 68 54 65 |t = * pW|E -> hTe|
|00003ab0| 78 74 20 3b 0d 09 53 49 | 6e 74 33 32 20 74 65 78 |xt ;..SI|nt32 tex|
|00003ac0| 74 4c 65 6e 67 74 68 20 | 3d 20 70 57 45 20 2d 3e |tLength |= pWE ->|
|00003ad0| 20 74 65 78 74 4c 65 6e | 67 74 68 20 3b 0d 09 57 | textLen|gth ;..W|
|00003ae0| 45 4c 69 6e 65 52 65 63 | 20 2a 20 70 53 74 61 72 |ELineRec| * pStar|
|00003af0| 74 4c 69 6e 65 20 3d 20 | 2a 20 70 57 45 20 2d 3e |tLine = |* pWE ->|
|00003b00| 20 68 4c 69 6e 65 73 20 | 2b 20 57 45 4f 66 66 73 | hLines |+ WEOffs|
|00003b10| 65 74 54 6f 4c 69 6e 65 | 20 28 20 6f 66 66 73 65 |etToLine| ( offse|
|00003b20| 74 2c 20 68 57 45 20 29 | 20 3b 0d 09 57 45 4c 69 |t, hWE )| ;..WELi|
|00003b30| 6e 65 52 65 63 20 2a 20 | 70 4c 69 6e 65 20 3b 0d |neRec * |pLine ;.|
|00003b40| 0d 09 2f 2f 09 73 63 61 | 6e 20 62 61 63 6b 77 61 |..//.sca|n backwa|
|00003b50| 72 64 73 20 74 68 65 20 | 6c 69 6e 65 20 61 72 72 |rds the |line arr|
|00003b60| 61 79 2c 20 6c 6f 6f 6b | 69 6e 67 20 66 6f 72 20 |ay, look|ing for |
|00003b70| 61 20 6c 69 6e 65 20 65 | 6e 64 69 6e 67 20 77 69 |a line e|nding wi|
|00003b80| 74 68 20 61 20 43 52 0d | 09 66 6f 72 20 28 0d 09 |th a CR.|.for (..|
|00003b90| 09 09 70 4c 69 6e 65 20 | 3d 20 70 53 74 61 72 74 |..pLine |= pStart|
|00003ba0| 4c 69 6e 65 20 3b 0d 09 | 09 09 28 20 70 4c 69 6e |Line ;..|..( pLin|
|00003bb0| 65 20 2d 3e 20 6c 69 6e | 65 53 74 61 72 74 20 3e |e -> lin|eStart >|
|00003bc0| 20 30 20 29 20 26 26 20 | 28 20 70 54 65 78 74 20 | 0 ) && |( pText |
|00003bd0| 5b 20 70 4c 69 6e 65 20 | 2d 3e 20 6c 69 6e 65 53 |[ pLine |-> lineS|
|00003be0| 74 61 72 74 20 2d 20 31 | 20 5d 20 21 3d 20 6b 45 |tart - 1| ] != kE|
|00003bf0| 4f 4c 20 29 20 3b 0d 09 | 09 09 70 4c 69 6e 65 20 |OL ) ;..|..pLine |
|00003c00| 2d 2d 0d 09 09 29 20 3b | 0d 09 69 66 20 28 20 70 |--...) ;|..if ( p|
|00003c10| 61 72 61 67 72 61 70 68 | 53 74 61 72 74 20 21 3d |aragraph|Start !=|
|00003c20| 20 6e 69 6c 20 29 0d 09 | 7b 0d 09 09 2a 20 70 61 | nil )..|{...* pa|
|00003c30| 72 61 67 72 61 70 68 53 | 74 61 72 74 20 3d 20 70 |ragraphS|tart = p|
|00003c40| 4c 69 6e 65 20 2d 3e 20 | 6c 69 6e 65 53 74 61 72 |Line -> |lineStar|
|00003c50| 74 20 3b 0d 09 7d 0d 0d | 09 2f 2f 09 6e 6f 77 20 |t ;..}..|.//.now |
|00003c60| 73 63 61 6e 20 66 6f 72 | 77 61 72 64 0d 09 66 6f |scan for|ward..fo|
|00003c70| 72 20 28 0d 09 09 09 70 | 4c 69 6e 65 20 3d 20 70 |r (....p|Line = p|
|00003c80| 53 74 61 72 74 4c 69 6e | 65 20 2b 20 31 20 3b 0d |StartLin|e + 1 ;.|
|00003c90| 09 09 09 28 20 70 4c 69 | 6e 65 20 2d 3e 20 6c 69 |...( pLi|ne -> li|
|00003ca0| 6e 65 53 74 61 72 74 20 | 3c 20 74 65 78 74 4c 65 |neStart |< textLe|
|00003cb0| 6e 67 74 68 20 29 20 26 | 26 20 28 20 70 54 65 78 |ngth ) &|& ( pTex|
|00003cc0| 74 20 5b 20 70 4c 69 6e | 65 20 2d 3e 20 6c 69 6e |t [ pLin|e -> lin|
|00003cd0| 65 53 74 61 72 74 20 2d | 20 31 20 5d 20 21 3d 20 |eStart -| 1 ] != |
|00003ce0| 6b 45 4f 4c 20 29 20 3b | 0d 09 09 09 70 4c 69 6e |kEOL ) ;|....pLin|
|00003cf0| 65 20 2b 2b 0d 09 09 29 | 20 3b 0d 09 69 66 20 28 |e ++...)| ;..if (|
|00003d00| 20 70 61 72 61 67 72 61 | 70 68 45 6e 64 20 21 3d | paragra|phEnd !=|
|00003d10| 20 6e 69 6c 20 29 0d 09 | 7b 0d 09 09 2a 20 70 61 | nil )..|{...* pa|
|00003d20| 72 61 67 72 61 70 68 45 | 6e 64 20 3d 20 70 4c 69 |ragraphE|nd = pLi|
|00003d30| 6e 65 20 2d 3e 20 6c 69 | 6e 65 53 74 61 72 74 20 |ne -> li|neStart |
|00003d40| 3b 0d 09 7d 0d 7d 0d 0d | 70 61 73 63 61 6c 20 53 |;..}.}..|pascal S|
|00003d50| 63 72 69 70 74 43 6f 64 | 65 20 5f 57 45 47 65 74 |criptCod|e _WEGet|
|00003d60| 43 6f 6e 74 65 78 74 28 | 53 49 6e 74 33 32 20 6f |Context(|SInt32 o|
|00003d70| 66 66 73 65 74 2c 20 53 | 49 6e 74 33 32 20 2a 63 |ffset, S|Int32 *c|
|00003d80| 6f 6e 74 65 78 74 53 74 | 61 72 74 2c 20 53 49 6e |ontextSt|art, SIn|
|00003d90| 74 33 32 20 2a 63 6f 6e | 74 65 78 74 45 6e 64 2c |t32 *con|textEnd,|
|00003da0| 0d 09 09 09 09 09 09 57 | 45 48 61 6e 64 6c 65 20 |.......W|EHandle |
|00003db0| 68 57 45 29 0d 7b 0d 09 | 2f 2f 20 54 68 69 73 20 |hWE).{..|// This |
|00003dc0| 66 75 6e 63 74 69 6f 6e | 20 66 69 6e 64 73 20 61 |function| finds a|
|00003dd0| 20 72 61 6e 67 65 20 6f | 66 20 63 68 61 72 61 63 | range o|f charac|
|00003de0| 74 65 72 73 20 28 22 63 | 6f 6e 74 65 78 74 22 29 |ters ("c|ontext")|
|00003df0| 2c 20 61 6c 6c 20 62 65 | 6c 6f 6e 67 69 6e 67 20 |, all be|longing |
|00003e00| 74 6f 20 74 68 65 20 73 | 61 6d 65 20 73 63 72 69 |to the s|ame scri|
|00003e10| 70 74 0d 09 2f 2f 20 61 | 6e 64 20 63 65 6e 74 65 |pt..// a|nd cente|
|00003e20| 72 65 64 20 61 72 6f 75 | 6e 64 20 74 68 65 20 73 |red arou|nd the s|
|00003e30| 70 65 63 69 66 69 65 64 | 20 6f 66 66 73 65 74 2e |pecified| offset.|
|00003e40| 0d 09 2f 2f 20 54 68 65 | 20 66 75 6e 63 74 69 6f |..// The| functio|
|00003e50| 6e 20 72 65 73 75 6c 74 | 20 69 73 20 74 68 65 20 |n result| is the |
|00003e60| 49 44 20 6f 66 20 61 20 | 66 6f 6e 74 20 62 65 6c |ID of a |font bel|
|00003e70| 6f 6e 67 69 6e 67 20 74 | 6f 20 74 68 69 73 20 73 |onging t|o this s|
|00003e80| 63 72 69 70 74 2e 0d 09 | 2f 2f 20 49 64 65 61 6c |cript...|// Ideal|
|00003e90| 6c 79 2c 20 74 68 65 20 | 63 6f 6e 74 65 78 74 20 |ly, the |context |
|00003ea0| 73 68 6f 75 6c 64 20 63 | 6f 6e 73 69 73 74 20 6f |should c|onsist o|
|00003eb0| 66 20 61 20 77 68 6f 6c | 65 20 73 63 72 69 70 74 |f a whol|e script|
|00003ec0| 20 72 75 6e 2c 20 62 75 | 74 20 69 6e 20 70 72 61 | run, bu|t in pra|
|00003ed0| 63 74 69 63 65 20 74 68 | 65 20 72 65 74 75 72 6e |ctice th|e return|
|00003ee0| 65 64 0d 09 2f 2f 20 63 | 6f 6e 74 65 78 74 20 63 |ed..// c|ontext c|
|00003ef0| 61 6e 20 62 65 20 6e 61 | 72 72 6f 77 65 72 2c 20 |an be na|rrower, |
|00003f00| 66 6f 72 20 70 65 72 66 | 6f 72 6d 61 6e 63 65 20 |for perf|ormance |
|00003f10| 61 6e 64 20 6f 74 68 65 | 72 20 72 65 61 73 6f 6e |and othe|r reason|
|00003f20| 73 20 28 73 65 65 20 62 | 65 6c 6f 77 29 0d 0d 09 |s (see b|elow)...|
|00003f30| 53 49 6e 74 33 32 20 69 | 6e 64 65 78 2c 20 73 61 |SInt32 i|ndex, sa|
|00003f40| 76 65 49 6e 64 65 78 2c | 20 73 61 76 65 52 75 6e |veIndex,| saveRun|
|00003f50| 45 6e 64 3b 0d 09 57 45 | 52 75 6e 49 6e 66 6f 50 |End;..WE|RunInfoP|
|00003f60| 72 69 76 20 72 75 6e 49 | 6e 66 6f 3b 0d 09 53 63 |riv runI|nfo;..Sc|
|00003f70| 72 69 70 74 43 6f 64 65 | 20 73 63 72 69 70 74 31 |riptCode| script1|
|00003f80| 2c 20 73 63 72 69 70 74 | 32 3b 0d 09 53 49 6e 74 |, script|2;..SInt|
|00003f90| 31 36 20 72 65 74 76 61 | 6c 3b 0d 0d 09 69 66 20 |16 retva|l;...if |
|00003fa0| 28 42 54 53 54 28 28 2a | 68 57 45 29 2d 3e 66 6c |(BTST((*|hWE)->fl|
|00003fb0| 61 67 73 2c 20 77 65 46 | 4e 6f 6e 52 6f 6d 61 6e |ags, weF|NonRoman|
|00003fc0| 29 29 0d 09 7b 0d 09 09 | 2f 2f 20 69 66 20 6d 6f |))..{...|// if mo|
|00003fd0| 72 65 20 74 68 61 6e 20 | 6f 6e 65 20 73 63 72 69 |re than |one scri|
|00003fe0| 70 74 20 69 73 20 69 6e | 73 74 61 6c 6c 65 64 2c |pt is in|stalled,|
|00003ff0| 20 6c 69 6d 69 74 20 74 | 68 65 20 73 65 61 72 63 | limit t|he searc|
|00004000| 68 20 6f 66 0d 09 09 2f | 2f 20 73 63 72 69 70 74 |h of.../|/ script|
|00004010| 20 72 75 6e 20 62 6f 75 | 6e 64 61 72 69 65 73 20 | run bou|ndaries |
|00004020| 74 6f 20 61 20 73 69 6e | 67 6c 65 20 70 61 72 61 |to a sin|gle para|
|00004030| 67 72 61 70 68 2c 20 66 | 6f 72 20 73 70 65 65 64 |graph, f|or speed|
|00004040| 27 73 20 73 61 6b 65 0d | 09 09 57 45 46 69 6e 64 |'s sake.|..WEFind|
|00004050| 50 61 72 61 67 72 61 70 | 68 28 6f 66 66 73 65 74 |Paragrap|h(offset|
|00004060| 2c 20 6b 4c 65 61 64 69 | 6e 67 45 64 67 65 2c 20 |, kLeadi|ngEdge, |
|00004070| 63 6f 6e 74 65 78 74 53 | 74 61 72 74 2c 20 63 6f |contextS|tart, co|
|00004080| 6e 74 65 78 74 45 6e 64 | 2c 20 68 57 45 29 3b 0d |ntextEnd|, hWE);.|
|00004090| 0d 09 09 2f 2f 20 66 69 | 6e 64 20 74 68 65 20 73 |...// fi|nd the s|
|000040a0| 74 79 6c 65 20 72 75 6e | 20 74 68 65 20 73 70 65 |tyle run| the spe|
|000040b0| 63 69 66 69 65 64 20 6f | 66 66 73 65 74 20 69 73 |cified o|ffset is|
|000040c0| 20 69 6e 0d 09 09 69 6e | 64 65 78 20 3d 20 57 45 | in...in|dex = WE|
|000040d0| 4f 66 66 73 65 74 54 6f | 52 75 6e 28 6f 66 66 73 |OffsetTo|Run(offs|
|000040e0| 65 74 2c 20 68 57 45 29 | 3b 0d 09 09 5f 57 45 47 |et, hWE)|;..._WEG|
|000040f0| 65 74 49 6e 64 53 74 79 | 6c 65 28 69 6e 64 65 78 |etIndSty|le(index|
|00004100| 2c 20 26 72 75 6e 49 6e | 66 6f 2c 20 68 57 45 29 |, &runIn|fo, hWE)|
|00004110| 3b 0d 0d 09 09 2f 2f 20 | 66 69 6e 64 20 74 68 65 |;....// |find the|
|00004120| 20 73 63 72 69 70 74 20 | 63 6f 64 65 20 61 73 73 | script |code ass|
|00004130| 6f 63 69 61 74 65 64 20 | 77 69 74 68 20 74 68 69 |ociated |with thi|
|00004140| 73 20 73 74 79 6c 65 20 | 72 75 6e 0d 09 09 73 63 |s style |run...sc|
|00004150| 72 69 70 74 31 20 3d 20 | 46 6f 6e 74 54 6f 53 63 |ript1 = |FontToSc|
|00004160| 72 69 70 74 28 72 75 6e | 49 6e 66 6f 2e 72 75 6e |ript(run|Info.run|
|00004170| 41 74 74 72 73 2e 72 75 | 6e 53 74 79 6c 65 2e 74 |Attrs.ru|nStyle.t|
|00004180| 73 46 6f 6e 74 29 3b 0d | 0d 09 09 2f 2f 20 74 68 |sFont);.|...// th|
|00004190| 65 20 73 63 72 69 70 74 | 20 63 6f 64 65 20 69 73 |e script| code is|
|000041a0| 20 72 65 74 75 72 6e 65 | 64 20 61 73 20 66 75 6e | returne|d as fun|
|000041b0| 63 74 69 6f 6e 20 72 65 | 73 75 6c 74 0d 09 09 72 |ction re|sult...r|
|000041c0| 65 74 76 61 6c 20 3d 20 | 73 63 72 69 70 74 31 3b |etval = |script1;|
|000041d0| 0d 0d 09 09 2f 2f 20 73 | 61 76 65 20 69 6e 64 65 |....// s|ave inde|
|000041e0| 78 20 61 6e 64 20 72 75 | 6e 49 6e 66 6f 2e 72 75 |x and ru|nInfo.ru|
|000041f0| 6e 45 6e 64 20 66 6f 72 | 20 74 68 65 20 73 65 63 |nEnd for| the sec|
|00004200| 6f 6e 64 20 77 68 69 6c | 65 20 6c 6f 6f 70 0d 09 |ond whil|e loop..|
|00004210| 09 73 61 76 65 49 6e 64 | 65 78 20 3d 20 69 6e 64 |.saveInd|ex = ind|
|00004220| 65 78 3b 0d 09 09 73 61 | 76 65 52 75 6e 45 6e 64 |ex;...sa|veRunEnd|
|00004230| 20 3d 20 72 75 6e 49 6e | 66 6f 2e 72 75 6e 45 6e | = runIn|fo.runEn|
|00004240| 64 3b 0d 0d 09 09 2f 2f | 20 77 61 6c 6b 20 62 61 |d;....//| walk ba|
|00004250| 63 6b 77 61 72 64 73 20 | 61 63 72 6f 73 73 20 73 |ckwards |across s|
|00004260| 74 79 6c 65 20 72 75 6e | 73 20 70 72 65 63 65 64 |tyle run|s preced|
|00004270| 69 6e 67 20 6f 66 66 73 | 65 74 2c 20 6c 6f 6f 6b |ing offs|et, look|
|00004280| 69 6e 67 20 66 6f 72 20 | 61 20 73 63 72 69 70 74 |ing for |a script|
|00004290| 20 72 75 6e 20 62 6f 75 | 6e 64 61 72 79 0d 09 09 | run bou|ndary...|
|000042a0| 77 68 69 6c 65 20 28 72 | 75 6e 49 6e 66 6f 2e 72 |while (r|unInfo.r|
|000042b0| 75 6e 53 74 61 72 74 20 | 3e 20 2a 63 6f 6e 74 65 |unStart |> *conte|
|000042c0| 78 74 53 74 61 72 74 29 | 0d 09 09 7b 0d 09 09 09 |xtStart)|...{....|
|000042d0| 69 6e 64 65 78 2d 2d 3b | 0d 09 09 09 5f 57 45 47 |index--;|...._WEG|
|000042e0| 65 74 49 6e 64 53 74 79 | 6c 65 28 69 6e 64 65 78 |etIndSty|le(index|
|000042f0| 2c 20 26 72 75 6e 49 6e | 66 6f 2c 20 68 57 45 29 |, &runIn|fo, hWE)|
|00004300| 3b 0d 09 09 09 73 63 72 | 69 70 74 32 20 3d 20 46 |;....scr|ipt2 = F|
|00004310| 6f 6e 74 54 6f 53 63 72 | 69 70 74 28 72 75 6e 49 |ontToScr|ipt(runI|
|00004320| 6e 66 6f 2e 72 75 6e 41 | 74 74 72 73 2e 72 75 6e |nfo.runA|ttrs.run|
|00004330| 53 74 79 6c 65 2e 74 73 | 46 6f 6e 74 29 3b 0d 09 |Style.ts|Font);..|
|00004340| 09 09 69 66 20 28 73 63 | 72 69 70 74 31 20 21 3d |..if (sc|ript1 !=|
|00004350| 20 73 63 72 69 70 74 32 | 29 0d 09 09 09 7b 0d 09 | script2|)....{..|
|00004360| 09 09 09 2a 63 6f 6e 74 | 65 78 74 53 74 61 72 74 |...*cont|extStart|
|00004370| 20 3d 20 72 75 6e 49 6e | 66 6f 2e 72 75 6e 45 6e | = runIn|fo.runEn|
|00004380| 64 3b 0d 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |d;.....b|reak;...|
|00004390| 09 7d 0d 09 09 7d 0d 0d | 09 09 2f 2f 20 72 65 73 |.}...}..|..// res|
|000043a0| 74 6f 72 65 20 69 6e 64 | 65 78 20 61 6e 64 20 72 |tore ind|ex and r|
|000043b0| 75 6e 49 6e 66 6f 2e 72 | 75 6e 45 6e 64 0d 09 09 |unInfo.r|unEnd...|
|000043c0| 69 6e 64 65 78 20 3d 20 | 73 61 76 65 49 6e 64 65 |index = |saveInde|
|000043d0| 78 3b 0d 09 09 72 75 6e | 49 6e 66 6f 2e 72 75 6e |x;...run|Info.run|
|000043e0| 45 6e 64 20 3d 20 73 61 | 76 65 52 75 6e 45 6e 64 |End = sa|veRunEnd|
|000043f0| 3b 0d 0d 09 09 2f 2f 20 | 77 61 6c 6b 20 66 6f 72 |;....// |walk for|
|00004400| 77 61 72 64 20 61 63 72 | 6f 73 73 20 73 74 79 6c |ward acr|oss styl|
|00004410| 65 20 72 75 6e 73 20 66 | 6f 6c 6c 6f 77 69 6e 67 |e runs f|ollowing|
|00004420| 20 6f 66 66 73 65 74 2c | 20 6c 6f 6f 6b 69 6e 67 | offset,| looking|
|00004430| 20 66 6f 72 20 61 20 73 | 63 72 69 70 74 20 72 75 | for a s|cript ru|
|00004440| 6e 20 62 6f 75 6e 64 61 | 72 79 0d 09 09 77 68 69 |n bounda|ry...whi|
|00004450| 6c 65 20 28 72 75 6e 49 | 6e 66 6f 2e 72 75 6e 45 |le (runI|nfo.runE|
|00004460| 6e 64 20 3c 20 2a 63 6f | 6e 74 65 78 74 45 6e 64 |nd < *co|ntextEnd|
|00004470| 29 0d 09 09 7b 0d 09 09 | 09 69 6e 64 65 78 2b 2b |)...{...|.index++|
|00004480| 3b 0d 09 09 09 5f 57 45 | 47 65 74 49 6e 64 53 74 |;...._WE|GetIndSt|
|00004490| 79 6c 65 28 69 6e 64 65 | 78 2c 20 26 72 75 6e 49 |yle(inde|x, &runI|
|000044a0| 6e 66 6f 2c 20 68 57 45 | 29 3b 0d 09 09 09 73 63 |nfo, hWE|);....sc|
|000044b0| 72 69 70 74 32 20 3d 20 | 46 6f 6e 74 54 6f 53 63 |ript2 = |FontToSc|
|000044c0| 72 69 70 74 28 72 75 6e | 49 6e 66 6f 2e 72 75 6e |ript(run|Info.run|
|000044d0| 41 74 74 72 73 2e 72 75 | 6e 53 74 79 6c 65 2e 74 |Attrs.ru|nStyle.t|
|000044e0| 73 46 6f 6e 74 29 3b 0d | 09 09 09 69 66 20 28 73 |sFont);.|...if (s|
|000044f0| 63 72 69 70 74 31 20 21 | 3d 20 73 63 72 69 70 74 |cript1 !|= script|
|00004500| 32 29 0d 09 09 09 7b 0d | 09 09 09 09 2a 63 6f 6e |2)....{.|....*con|
|00004510| 74 65 78 74 45 6e 64 20 | 3d 20 72 75 6e 49 6e 66 |textEnd |= runInf|
|00004520| 6f 2e 72 75 6e 53 74 61 | 72 74 3b 0d 09 09 09 09 |o.runSta|rt;.....|
|00004530| 62 72 65 61 6b 3b 0d 09 | 09 09 7d 0d 09 09 7d 0d |break;..|..}...}.|
|00004540| 09 7d 0d 09 65 6c 73 65 | 0d 09 7b 0d 09 09 2f 2f |.}..else|..{...//|
|00004550| 20 6f 6e 6c 79 20 74 68 | 65 20 52 6f 6d 61 6e 20 | only th|e Roman |
|00004560| 73 63 72 69 70 74 20 69 | 73 20 65 6e 61 62 6c 65 |script i|s enable|
|00004570| 64 3a 20 74 68 65 20 77 | 68 6f 6c 65 20 74 65 78 |d: the w|hole tex|
|00004580| 74 20 63 6f 6e 73 74 69 | 74 75 74 65 73 20 6f 6e |t consti|tutes on|
|00004590| 65 20 73 63 72 69 70 74 | 20 72 75 6e 0d 09 09 72 |e script| run...r|
|000045a0| 65 74 76 61 6c 20 3d 20 | 73 6d 52 6f 6d 61 6e 3b |etval = |smRoman;|
|000045b0| 0d 09 09 2a 63 6f 6e 74 | 65 78 74 53 74 61 72 74 |...*cont|extStart|
|000045c0| 20 3d 20 30 3b 0d 09 09 | 2a 63 6f 6e 74 65 78 74 | = 0;...|*context|
|000045d0| 45 6e 64 20 3d 20 28 2a | 68 57 45 29 2d 3e 74 65 |End = (*|hWE)->te|
|000045e0| 78 74 4c 65 6e 67 74 68 | 3b 0d 09 7d 0d 0d 09 2f |xtLength|;..}.../|
|000045f0| 2f 20 6d 61 6b 65 20 73 | 75 72 65 20 74 68 65 20 |/ make s|ure the |
|00004600| 72 61 6e 67 65 20 69 64 | 65 6e 74 69 66 69 65 64 |range id|entified|
|00004610| 20 62 79 20 63 6f 6e 74 | 65 78 74 53 74 61 72 74 | by cont|extStart|
|00004620| 2f 63 6f 6e 74 65 78 74 | 45 6e 64 20 69 73 20 63 |/context|End is c|
|00004630| 6f 6e 74 61 69 6e 65 64 | 20 77 69 74 68 69 6e 0d |ontained| within.|
|00004640| 09 2f 2f 20 74 68 65 20 | 33 32 4b 20 62 79 74 65 |.// the |32K byte|
|00004650| 20 72 61 6e 67 65 20 63 | 65 6e 74 65 72 65 64 20 | range c|entered |
|00004660| 61 72 6f 75 6e 64 20 74 | 68 65 20 73 70 65 63 69 |around t|he speci|
|00004670| 66 69 65 64 20 6f 66 66 | 73 65 74 0d 09 2f 2f 20 |fied off|set..// |
|00004680| 74 68 65 20 72 65 61 73 | 6f 6e 20 66 6f 72 20 74 |the reas|on for t|
|00004690| 68 69 73 20 69 73 20 74 | 68 61 74 20 6d 61 6e 79 |his is t|hat many|
|000046a0| 20 53 63 72 69 70 74 20 | 4d 61 6e 61 67 65 72 20 | Script |Manager |
|000046b0| 72 6f 75 74 69 6e 65 73 | 20 28 65 2e 67 2e 20 46 |routines| (e.g. F|
|000046c0| 69 6e 64 57 6f 72 64 20 | 61 6e 64 20 43 68 61 72 |indWord |and Char|
|000046d0| 42 79 74 65 29 0d 09 2f | 2f 20 6f 6e 6c 79 20 61 |Byte)../|/ only a|
|000046e0| 63 63 65 70 74 20 31 36 | 2d 62 69 74 20 6f 66 66 |ccept 16|-bit off|
|000046f0| 73 65 74 73 2c 20 72 61 | 74 68 65 72 20 74 68 61 |sets, ra|ther tha|
|00004700| 6e 20 33 32 2d 62 69 74 | 20 6f 66 66 73 65 74 73 |n 32-bit| offsets|
|00004710| 0d 0d 09 2a 63 6f 6e 74 | 65 78 74 53 74 61 72 74 |...*cont|extStart|
|00004720| 20 3d 20 5f 57 45 50 69 | 6e 49 6e 52 61 6e 67 65 | = _WEPi|nInRange|
|00004730| 28 2a 63 6f 6e 74 65 78 | 74 53 74 61 72 74 2c 20 |(*contex|tStart, |
|00004740| 6f 66 66 73 65 74 20 2d | 20 28 53 48 52 54 5f 4d |offset -| (SHRT_M|
|00004750| 41 58 20 2f 20 32 29 2c | 20 6f 66 66 73 65 74 29 |AX / 2),| offset)|
|00004760| 3b 0d 09 2a 63 6f 6e 74 | 65 78 74 45 6e 64 20 3d |;..*cont|extEnd =|
|00004770| 20 5f 57 45 50 69 6e 49 | 6e 52 61 6e 67 65 28 2a | _WEPinI|nRange(*|
|00004780| 63 6f 6e 74 65 78 74 45 | 6e 64 2c 20 6f 66 66 73 |contextE|nd, offs|
|00004790| 65 74 2c 20 6f 66 66 73 | 65 74 20 2b 20 28 53 48 |et, offs|et + (SH|
|000047a0| 52 54 5f 4d 41 58 20 2f | 20 32 29 29 3b 0d 0d 09 |RT_MAX /| 2));...|
|000047b0| 72 65 74 75 72 6e 20 72 | 65 74 76 61 6c 3b 0d 7d |return r|etval;.}|
|000047c0| 0d 0d 70 61 73 63 61 6c | 20 53 63 72 69 70 74 43 |..pascal| ScriptC|
|000047d0| 6f 64 65 20 5f 57 45 47 | 65 74 52 65 73 74 72 69 |ode _WEG|etRestri|
|000047e0| 63 74 65 64 43 6f 6e 74 | 65 78 74 28 53 49 6e 74 |ctedCont|ext(SInt|
|000047f0| 33 32 20 6f 66 66 73 65 | 74 2c 20 53 49 6e 74 33 |32 offse|t, SInt3|
|00004800| 32 20 2a 63 6f 6e 74 65 | 78 74 53 74 61 72 74 2c |2 *conte|xtStart,|
|00004810| 20 53 49 6e 74 33 32 20 | 2a 63 6f 6e 74 65 78 74 | SInt32 |*context|
|00004820| 45 6e 64 2c 0d 09 09 09 | 09 09 09 57 45 48 61 6e |End,....|...WEHan|
|00004830| 64 6c 65 20 68 57 45 29 | 0d 7b 0d 09 2f 2f 20 54 |dle hWE)|.{..// T|
|00004840| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 66 69 6e |his func|tion fin|
|00004850| 64 73 20 61 20 72 61 6e | 67 65 20 6f 66 20 63 68 |ds a ran|ge of ch|
|00004860| 61 72 61 63 74 65 72 73 | 20 28 22 63 6f 6e 74 65 |aracters| ("conte|
|00004870| 78 74 22 29 2c 20 61 6c | 6c 20 62 65 6c 6f 6e 67 |xt"), al|l belong|
|00004880| 69 6e 67 20 74 6f 20 74 | 68 65 20 73 61 6d 65 20 |ing to t|he same |
|00004890| 73 63 72 69 70 74 0d 09 | 2f 2f 20 61 6e 64 20 63 |script..|// and c|
|000048a0| 65 6e 74 65 72 65 64 20 | 61 72 6f 75 6e 64 20 74 |entered |around t|
|000048b0| 68 65 20 73 70 65 63 69 | 66 69 65 64 20 6f 66 66 |he speci|fied off|
|000048c0| 73 65 74 2e 0d 09 2f 2f | 20 54 68 69 73 20 66 75 |set...//| This fu|
|000048d0| 6e 63 74 69 6f 6e 20 72 | 65 74 75 72 6e 73 20 61 |nction r|eturns a|
|000048e0| 20 73 63 72 69 70 74 20 | 72 75 6e 20 73 75 62 72 | script |run subr|
|000048f0| 61 6e 67 65 20 61 6e 64 | 20 69 73 20 6d 6f 72 65 |ange and| is more|
|00004900| 20 65 66 66 69 63 69 65 | 6e 74 20 74 68 61 6e 0d | efficie|nt than.|
|00004910| 09 2f 2f 20 5f 57 45 47 | 65 74 43 6f 6e 74 65 78 |.// _WEG|etContex|
|00004920| 74 20 62 65 63 61 75 73 | 65 20 69 74 20 64 6f 65 |t becaus|e it doe|
|00004930| 73 6e 27 74 20 74 72 79 | 20 74 6f 20 66 69 6e 64 |sn't try| to find|
|00004940| 20 74 68 65 20 73 63 72 | 69 70 74 20 62 6f 75 6e | the scr|ipt boun|
|00004950| 64 61 72 69 65 73 20 61 | 63 63 75 72 61 74 65 6c |daries a|ccuratel|
|00004960| 79 2e 0d 0d 09 57 45 52 | 75 6e 49 6e 66 6f 50 72 |y....WER|unInfoPr|
|00004970| 69 76 20 72 75 6e 49 6e | 66 6f 3b 0d 0d 09 2f 2f |iv runIn|fo;...//|
|00004980| 20 6a 75 73 74 20 66 69 | 6e 64 20 74 68 65 20 73 | just fi|nd the s|
|00004990| 74 79 6c 65 20 72 75 6e | 20 74 68 65 20 73 70 65 |tyle run| the spe|
|000049a0| 63 69 66 69 65 64 20 6f | 66 66 73 65 74 20 69 73 |cified o|ffset is|
|000049b0| 20 69 6e 0d 09 57 45 47 | 65 74 52 75 6e 49 6e 66 | in..WEG|etRunInf|
|000049c0| 6f 28 6f 66 66 73 65 74 | 2c 20 28 57 45 52 75 6e |o(offset|, (WERun|
|000049d0| 49 6e 66 6f 20 2a 29 26 | 72 75 6e 49 6e 66 6f 2c |Info *)&|runInfo,|
|000049e0| 20 68 57 45 29 3b 0d 09 | 2a 63 6f 6e 74 65 78 74 | hWE);..|*context|
|000049f0| 53 74 61 72 74 20 3d 20 | 72 75 6e 49 6e 66 6f 2e |Start = |runInfo.|
|00004a00| 72 75 6e 53 74 61 72 74 | 3b 0d 09 2a 63 6f 6e 74 |runStart|;..*cont|
|00004a10| 65 78 74 45 6e 64 20 3d | 20 72 75 6e 49 6e 66 6f |extEnd =| runInfo|
|00004a20| 2e 72 75 6e 45 6e 64 3b | 0d 0d 09 2f 2f 20 6d 61 |.runEnd;|...// ma|
|00004a30| 6b 65 20 73 75 72 65 20 | 74 68 65 20 72 61 6e 67 |ke sure |the rang|
|00004a40| 65 20 69 64 65 6e 74 69 | 66 69 65 64 20 62 79 20 |e identi|fied by |
|00004a50| 63 6f 6e 74 65 78 74 53 | 74 61 72 74 2f 63 6f 6e |contextS|tart/con|
|00004a60| 74 65 78 74 45 6e 64 20 | 69 73 20 63 6f 6e 74 61 |textEnd |is conta|
|00004a70| 69 6e 65 64 20 77 69 74 | 68 69 6e 0d 09 2f 2f 20 |ined wit|hin..// |
|00004a80| 74 68 65 20 33 32 4b 20 | 62 79 74 65 20 72 61 6e |the 32K |byte ran|
|00004a90| 67 65 20 63 65 6e 74 65 | 72 65 64 20 61 72 6f 75 |ge cente|red arou|
|00004aa0| 6e 64 20 74 68 65 20 73 | 70 65 63 69 66 69 65 64 |nd the s|pecified|
|00004ab0| 20 6f 66 66 73 65 74 0d | 09 2f 2f 20 74 68 65 20 | offset.|.// the |
|00004ac0| 72 65 61 73 6f 6e 20 66 | 6f 72 20 74 68 69 73 20 |reason f|or this |
|00004ad0| 69 73 20 74 68 61 74 20 | 6d 61 6e 79 20 53 63 72 |is that |many Scr|
|00004ae0| 69 70 74 20 4d 61 6e 61 | 67 65 72 20 72 6f 75 74 |ipt Mana|ger rout|
|00004af0| 69 6e 65 73 20 28 65 2e | 67 2e 20 46 69 6e 64 57 |ines (e.|g. FindW|
|00004b00| 6f 72 64 20 61 6e 64 20 | 43 68 61 72 42 79 74 65 |ord and |CharByte|
|00004b10| 29 0d 09 2f 2f 20 6f 6e | 6c 79 20 61 63 63 65 70 |)..// on|ly accep|
|00004b20| 74 20 31 36 2d 62 69 74 | 20 6f 66 66 73 65 74 73 |t 16-bit| offsets|
|00004b30| 2c 20 72 61 74 68 65 72 | 20 74 68 61 6e 20 33 32 |, rather| than 32|
|00004b40| 2d 62 69 74 20 6f 66 66 | 73 65 74 73 0d 0d 09 2a |-bit off|sets...*|
|00004b50| 63 6f 6e 74 65 78 74 53 | 74 61 72 74 20 3d 20 5f |contextS|tart = _|
|00004b60| 57 45 50 69 6e 49 6e 52 | 61 6e 67 65 28 2a 63 6f |WEPinInR|ange(*co|
|00004b70| 6e 74 65 78 74 53 74 61 | 72 74 2c 20 6f 66 66 73 |ntextSta|rt, offs|
|00004b80| 65 74 20 2d 20 28 53 48 | 52 54 5f 4d 41 58 20 2f |et - (SH|RT_MAX /|
|00004b90| 20 32 29 2c 20 6f 66 66 | 73 65 74 29 3b 0d 09 2a | 2), off|set);..*|
|00004ba0| 63 6f 6e 74 65 78 74 45 | 6e 64 20 3d 20 5f 57 45 |contextE|nd = _WE|
|00004bb0| 50 69 6e 49 6e 52 61 6e | 67 65 28 2a 63 6f 6e 74 |PinInRan|ge(*cont|
|00004bc0| 65 78 74 45 6e 64 2c 20 | 6f 66 66 73 65 74 2c 20 |extEnd, |offset, |
|00004bd0| 6f 66 66 73 65 74 20 2b | 20 28 53 48 52 54 5f 4d |offset +| (SHRT_M|
|00004be0| 41 58 20 2f 20 32 29 29 | 3b 0d 0d 09 72 65 74 75 |AX / 2))|;...retu|
|00004bf0| 72 6e 20 46 6f 6e 74 54 | 6f 53 63 72 69 70 74 28 |rn FontT|oScript(|
|00004c00| 72 75 6e 49 6e 66 6f 2e | 72 75 6e 41 74 74 72 73 |runInfo.|runAttrs|
|00004c10| 2e 72 75 6e 53 74 79 6c | 65 2e 74 73 46 6f 6e 74 |.runStyl|e.tsFont|
|00004c20| 29 3b 0d 7d 0d 0d 70 61 | 73 63 61 6c 20 76 6f 69 |);.}..pa|scal voi|
|00004c30| 64 20 57 45 46 69 6e 64 | 57 6f 72 64 28 53 49 6e |d WEFind|Word(SIn|
|00004c40| 74 33 32 20 6f 66 66 73 | 65 74 2c 20 57 45 45 64 |t32 offs|et, WEEd|
|00004c50| 67 65 20 65 64 67 65 2c | 20 53 49 6e 74 33 32 20 |ge edge,| SInt32 |
|00004c60| 2a 77 6f 72 64 53 74 61 | 72 74 2c 20 53 49 6e 74 |*wordSta|rt, SInt|
|00004c70| 33 32 20 2a 77 6f 72 64 | 45 6e 64 2c 20 57 45 48 |32 *word|End, WEH|
|00004c80| 61 6e 64 6c 65 20 68 57 | 45 29 0d 7b 0d 09 57 45 |andle hW|E).{..WE|
|00004c90| 50 74 72 20 70 57 45 3b | 0d 09 53 63 72 69 70 74 |Ptr pWE;|..Script|
|00004ca0| 43 6f 64 65 20 73 63 72 | 69 70 74 3b 0d 09 53 49 |Code scr|ipt;..SI|
|00004cb0| 6e 74 33 32 20 63 6f 6e | 74 65 78 74 53 74 61 72 |nt32 con|textStar|
|00004cc0| 74 2c 20 63 6f 6e 74 65 | 78 74 45 6e 64 3b 0d 09 |t, conte|xtEnd;..|
|00004cd0| 48 61 6e 64 6c 65 20 68 | 54 65 78 74 3b 0d 09 4f |Handle h|Text;..O|
|00004ce0| 66 66 73 65 74 54 61 62 | 6c 65 20 77 6f 72 64 42 |ffsetTab|le wordB|
|00004cf0| 72 65 61 6b 73 3b 0d 09 | 42 6f 6f 6c 65 61 6e 20 |reaks;..|Boolean |
|00004d00| 73 61 76 65 54 65 78 74 | 4c 6f 63 6b 2c 20 73 61 |saveText|Lock, sa|
|00004d10| 76 65 57 45 4c 6f 63 6b | 3b 0d 0d 09 2f 2f 20 6c |veWELock|;...// l|
|00004d20| 6f 63 6b 20 74 68 65 20 | 57 45 20 72 65 63 6f 72 |ock the |WE recor|
|00004d30| 64 0d 09 73 61 76 65 57 | 45 4c 6f 63 6b 20 3d 20 |d..saveW|ELock = |
|00004d40| 5f 57 45 53 65 74 48 61 | 6e 64 6c 65 4c 6f 63 6b |_WESetHa|ndleLock|
|00004d50| 28 28 48 61 6e 64 6c 65 | 29 20 68 57 45 2c 20 74 |((Handle|) hWE, t|
|00004d60| 72 75 65 29 3b 0d 09 70 | 57 45 20 3d 20 2a 68 57 |rue);..p|WE = *hW|
|00004d70| 45 3b 0d 0d 09 2f 2f 20 | 66 69 6e 64 20 61 20 73 |E;...// |find a s|
|00004d80| 63 72 69 70 74 20 63 6f | 6e 74 65 78 74 20 63 6f |cript co|ntext co|
|00004d90| 6e 74 61 69 6e 69 6e 67 | 20 74 68 65 20 73 70 65 |ntaining| the spe|
|00004da0| 63 69 66 69 65 64 20 6f | 66 66 73 65 74 0d 09 2f |cified o|ffset../|
|00004db0| 2f 20 28 77 6f 72 64 73 | 20 63 61 6e 6e 6f 74 20 |/ (words| cannot |
|00004dc0| 73 74 72 61 64 64 6c 65 | 20 73 63 72 69 70 74 20 |straddle| script |
|00004dd0| 62 6f 75 6e 64 61 72 69 | 65 73 29 0d 09 73 63 72 |boundari|es)..scr|
|00004de0| 69 70 74 20 3d 20 5f 57 | 45 47 65 74 43 6f 6e 74 |ipt = _W|EGetCont|
|00004df0| 65 78 74 28 6f 66 66 73 | 65 74 2c 20 26 63 6f 6e |ext(offs|et, &con|
|00004e00| 74 65 78 74 53 74 61 72 | 74 2c 20 26 63 6f 6e 74 |textStar|t, &cont|
|00004e10| 65 78 74 45 6e 64 2c 20 | 68 57 45 29 3b 0d 0d 09 |extEnd, |hWE);...|
|00004e20| 2f 2f 20 6c 6f 63 6b 20 | 74 68 65 20 74 65 78 74 |// lock |the text|
|00004e30| 0d 09 68 54 65 78 74 20 | 3d 20 70 57 45 2d 3e 68 |..hText |= pWE->h|
|00004e40| 54 65 78 74 3b 0d 09 73 | 61 76 65 54 65 78 74 4c |Text;..s|aveTextL|
|00004e50| 6f 63 6b 20 3d 20 5f 57 | 45 53 65 74 48 61 6e 64 |ock = _W|ESetHand|
|00004e60| 6c 65 4c 6f 63 6b 28 68 | 54 65 78 74 2c 20 74 72 |leLock(h|Text, tr|
|00004e70| 75 65 29 3b 0d 0d 09 2f | 2f 20 63 61 6c 6c 20 74 |ue);.../|/ call t|
|00004e80| 68 65 20 77 6f 72 64 20 | 62 72 65 61 6b 20 68 6f |he word |break ho|
|00004e90| 6f 6b 0d 09 43 61 6c 6c | 57 45 57 6f 72 64 42 72 |ok..Call|WEWordBr|
|00004ea0| 65 61 6b 50 72 6f 63 28 | 2a 68 54 65 78 74 20 2b |eakProc(|*hText +|
|00004eb0| 20 63 6f 6e 74 65 78 74 | 53 74 61 72 74 2c 20 63 | context|Start, c|
|00004ec0| 6f 6e 74 65 78 74 45 6e | 64 20 2d 20 63 6f 6e 74 |ontextEn|d - cont|
|00004ed0| 65 78 74 53 74 61 72 74 | 2c 0d 09 09 6f 66 66 73 |extStart|,...offs|
|00004ee0| 65 74 20 2d 20 63 6f 6e | 74 65 78 74 53 74 61 72 |et - con|textStar|
|00004ef0| 74 2c 20 65 64 67 65 2c | 20 77 6f 72 64 42 72 65 |t, edge,| wordBre|
|00004f00| 61 6b 73 2c 20 73 63 72 | 69 70 74 2c 20 68 57 45 |aks, scr|ipt, hWE|
|00004f10| 2c 20 70 57 45 2d 3e 77 | 6f 72 64 42 72 65 61 6b |, pWE->w|ordBreak|
|00004f20| 48 6f 6f 6b 29 3b 0d 0d | 09 2f 2f 20 75 6e 6c 6f |Hook);..|.// unlo|
|00004f30| 63 6b 20 74 68 65 20 74 | 65 78 74 0d 09 5f 57 45 |ck the t|ext.._WE|
|00004f40| 53 65 74 48 61 6e 64 6c | 65 4c 6f 63 6b 28 68 54 |SetHandl|eLock(hT|
|00004f50| 65 78 74 2c 20 73 61 76 | 65 54 65 78 74 4c 6f 63 |ext, sav|eTextLoc|
|00004f60| 6b 29 3b 0d 0d 09 2f 2f | 20 63 61 6c 63 75 6c 61 |k);...//| calcula|
|00004f70| 74 65 20 77 6f 72 64 53 | 74 61 72 74 20 61 6e 64 |te wordS|tart and|
|00004f80| 20 77 6f 72 64 45 6e 64 | 20 72 65 6c 61 74 69 76 | wordEnd| relativ|
|00004f90| 65 20 74 6f 20 74 68 65 | 20 62 65 67 69 6e 6e 69 |e to the| beginni|
|00004fa0| 6e 67 20 6f 66 20 74 68 | 65 20 74 65 78 74 0d 09 |ng of th|e text..|
|00004fb0| 69 66 20 28 77 6f 72 64 | 53 74 61 72 74 20 21 3d |if (word|Start !=|
|00004fc0| 20 6e 69 6c 29 0d 09 7b | 0d 09 09 2a 77 6f 72 64 | nil)..{|...*word|
|00004fd0| 53 74 61 72 74 20 3d 20 | 63 6f 6e 74 65 78 74 53 |Start = |contextS|
|00004fe0| 74 61 72 74 20 2b 20 77 | 6f 72 64 42 72 65 61 6b |tart + w|ordBreak|
|00004ff0| 73 5b 30 5d 2e 6f 66 66 | 46 69 72 73 74 3b 0d 09 |s[0].off|First;..|
|00005000| 7d 0d 09 69 66 20 28 77 | 6f 72 64 45 6e 64 20 21 |}..if (w|ordEnd !|
|00005010| 3d 20 6e 69 6c 29 0d 09 | 7b 0d 09 09 2a 77 6f 72 |= nil)..|{...*wor|
|00005020| 64 45 6e 64 20 3d 20 63 | 6f 6e 74 65 78 74 53 74 |dEnd = c|ontextSt|
|00005030| 61 72 74 20 2b 20 77 6f | 72 64 42 72 65 61 6b 73 |art + wo|rdBreaks|
|00005040| 5b 30 5d 2e 6f 66 66 53 | 65 63 6f 6e 64 3b 0d 09 |[0].offS|econd;..|
|00005050| 7d 0d 7d 0d 0d 70 61 73 | 63 61 6c 20 53 49 6e 74 |}.}..pas|cal SInt|
|00005060| 31 36 20 57 45 43 68 61 | 72 42 79 74 65 28 53 49 |16 WECha|rByte(SI|
|00005070| 6e 74 33 32 20 6f 66 66 | 73 65 74 2c 20 57 45 48 |nt32 off|set, WEH|
|00005080| 61 6e 64 6c 65 20 68 57 | 45 29 0d 7b 0d 09 57 45 |andle hW|E).{..WE|
|00005090| 50 74 72 20 70 57 45 3b | 0d 09 48 61 6e 64 6c 65 |Ptr pWE;|..Handle|
|000050a0| 20 68 54 65 78 74 3b 0d | 09 53 49 6e 74 33 32 20 | hText;.|.SInt32 |
|000050b0| 63 6f 6e 74 65 78 74 53 | 74 61 72 74 2c 20 63 6f |contextS|tart, co|
|000050c0| 6e 74 65 78 74 45 6e 64 | 3b 0d 09 53 63 72 69 70 |ntextEnd|;..Scrip|
|000050d0| 74 43 6f 64 65 20 73 63 | 72 69 70 74 3b 0d 09 42 |tCode sc|ript;..B|
|000050e0| 6f 6f 6c 65 61 6e 20 73 | 61 76 65 57 45 4c 6f 63 |oolean s|aveWELoc|
|000050f0| 6b 2c 20 73 61 76 65 54 | 65 78 74 4c 6f 63 6b 3b |k, saveT|extLock;|
|00005100| 0d 09 53 49 6e 74 31 36 | 20 72 65 74 76 61 6c 20 |..SInt16| retval |
|00005110| 3d 20 73 6d 53 69 6e 67 | 6c 65 42 79 74 65 3b 0d |= smSing|leByte;.|
|00005120| 0d 09 2f 2f 20 6c 6f 63 | 6b 20 74 68 65 20 57 45 |..// loc|k the WE|
|00005130| 20 72 65 63 6f 72 64 0d | 09 73 61 76 65 57 45 4c | record.|.saveWEL|
|00005140| 6f 63 6b 20 3d 20 5f 57 | 45 53 65 74 48 61 6e 64 |ock = _W|ESetHand|
|00005150| 6c 65 4c 6f 63 6b 28 28 | 48 61 6e 64 6c 65 29 20 |leLock((|Handle) |
|00005160| 68 57 45 2c 20 74 72 75 | 65 29 3b 0d 09 70 57 45 |hWE, tru|e);..pWE|
|00005170| 20 3d 20 2a 68 57 45 3b | 0d 0d 09 2f 2f 20 64 6f | = *hWE;|...// do|
|00005180| 20 6e 6f 74 68 69 6e 67 | 20 75 6e 6c 65 73 73 20 | nothing| unless |
|00005190| 74 68 65 72 65 20 69 73 | 20 61 74 20 6c 65 61 73 |there is| at leas|
|000051a0| 74 20 6f 6e 65 20 64 6f | 75 62 6c 65 2d 62 79 74 |t one do|uble-byt|
|000051b0| 65 20 73 63 72 69 70 74 | 20 73 79 73 74 65 6d 20 |e script| system |
|000051c0| 69 6e 73 74 61 6c 6c 65 | 64 0d 09 2f 2f 20 61 6e |installe|d..// an|
|000051d0| 64 20 6d 61 6b 65 20 73 | 75 72 65 20 6f 66 66 73 |d make s|ure offs|
|000051e0| 65 74 20 69 73 20 77 69 | 74 68 69 6e 20 61 6c 6c |et is wi|thin all|
|000051f0| 6f 77 65 64 20 62 6f 75 | 6e 64 73 0d 09 69 66 20 |owed bou|nds..if |
|00005200| 28 42 54 53 54 28 70 57 | 45 2d 3e 66 6c 61 67 73 |(BTST(pW|E->flags|
|00005210| 2c 20 77 65 46 44 6f 75 | 62 6c 65 42 79 74 65 29 |, weFDou|bleByte)|
|00005220| 29 0d 09 7b 0d 09 09 69 | 66 20 28 28 6f 66 66 73 |)..{...i|f ((offs|
|00005230| 65 74 20 3e 3d 20 30 29 | 20 26 26 20 28 6f 66 66 |et >= 0)| && (off|
|00005240| 73 65 74 20 3c 20 70 57 | 45 2d 3e 74 65 78 74 4c |set < pW|E->textL|
|00005250| 65 6e 67 74 68 29 29 0d | 09 09 7b 0d 0d 09 09 09 |ength)).|..{.....|
|00005260| 2f 2f 20 66 69 6e 64 20 | 61 20 73 63 72 69 70 74 |// find |a script|
|00005270| 20 63 6f 6e 74 65 78 74 | 20 63 6f 6e 74 61 69 6e | context| contain|
|00005280| 69 6e 67 20 74 68 65 20 | 73 70 65 63 69 66 69 65 |ing the |specifie|
|00005290| 64 20 6f 66 66 73 65 74 | 0d 09 09 09 73 63 72 69 |d offset|....scri|
|000052a0| 70 74 20 3d 20 5f 57 45 | 47 65 74 52 65 73 74 72 |pt = _WE|GetRestr|
|000052b0| 69 63 74 65 64 43 6f 6e | 74 65 78 74 28 6f 66 66 |ictedCon|text(off|
|000052c0| 73 65 74 2c 20 26 63 6f | 6e 74 65 78 74 53 74 61 |set, &co|ntextSta|
|000052d0| 72 74 2c 20 26 63 6f 6e | 74 65 78 74 45 6e 64 2c |rt, &con|textEnd,|
|000052e0| 20 68 57 45 29 3b 0d 0d | 09 09 09 2f 2f 20 6c 6f | hWE);..|...// lo|
|000052f0| 63 6b 20 74 68 65 20 74 | 65 78 74 0d 09 09 09 68 |ck the t|ext....h|
|00005300| 54 65 78 74 20 3d 20 70 | 57 45 2d 3e 68 54 65 78 |Text = p|WE->hTex|
|00005310| 74 3b 0d 09 09 09 73 61 | 76 65 54 65 78 74 4c 6f |t;....sa|veTextLo|
|00005320| 63 6b 20 3d 20 5f 57 45 | 53 65 74 48 61 6e 64 6c |ck = _WE|SetHandl|
|00005330| 65 4c 6f 63 6b 28 68 54 | 65 78 74 2c 20 74 72 75 |eLock(hT|ext, tru|
|00005340| 65 29 3b 0d 0d 09 09 09 | 2f 2f 20 70 61 73 73 20 |e);.....|// pass |
|00005350| 74 68 65 20 43 68 61 72 | 42 79 74 65 20 68 6f 6f |the Char|Byte hoo|
|00005360| 6b 20 61 20 70 6f 69 6e | 74 65 72 20 74 6f 20 74 |k a poin|ter to t|
|00005370| 68 65 20 62 65 67 69 6e | 6e 69 6e 67 20 6f 66 20 |he begin|ning of |
|00005380| 74 68 65 20 73 74 79 6c | 65 20 72 75 6e 0d 09 09 |the styl|e run...|
|00005390| 09 72 65 74 76 61 6c 20 | 3d 20 43 61 6c 6c 57 45 |.retval |= CallWE|
|000053a0| 43 68 61 72 42 79 74 65 | 50 72 6f 63 28 2a 68 54 |CharByte|Proc(*hT|
|000053b0| 65 78 74 20 2b 20 63 6f | 6e 74 65 78 74 53 74 61 |ext + co|ntextSta|
|000053c0| 72 74 2c 0d 09 09 09 09 | 6f 66 66 73 65 74 20 2d |rt,.....|offset -|
|000053d0| 20 63 6f 6e 74 65 78 74 | 53 74 61 72 74 2c 20 73 | context|Start, s|
|000053e0| 63 72 69 70 74 2c 20 68 | 57 45 2c 20 70 57 45 2d |cript, h|WE, pWE-|
|000053f0| 3e 63 68 61 72 42 79 74 | 65 48 6f 6f 6b 29 3b 0d |>charByt|eHook);.|
|00005400| 0d 09 09 09 2f 2f 20 75 | 6e 6c 6f 63 6b 20 74 68 |....// u|nlock th|
|00005410| 65 20 74 65 78 74 0d 09 | 09 09 5f 57 45 53 65 74 |e text..|.._WESet|
|00005420| 48 61 6e 64 6c 65 4c 6f | 63 6b 28 68 54 65 78 74 |HandleLo|ck(hText|
|00005430| 2c 20 73 61 76 65 54 65 | 78 74 4c 6f 63 6b 29 3b |, saveTe|xtLock);|
|00005440| 0d 09 09 7d 0d 09 7d 0d | 0d 09 2f 2f 20 75 6e 6c |...}..}.|..// unl|
|00005450| 6f 63 6b 20 74 68 65 20 | 57 45 20 72 65 63 6f 72 |ock the |WE recor|
|00005460| 64 0d 09 5f 57 45 53 65 | 74 48 61 6e 64 6c 65 4c |d.._WESe|tHandleL|
|00005470| 6f 63 6b 28 28 48 61 6e | 64 6c 65 29 20 68 57 45 |ock((Han|dle) hWE|
|00005480| 2c 20 73 61 76 65 57 45 | 4c 6f 63 6b 29 3b 0d 0d |, saveWE|Lock);..|
|00005490| 09 72 65 74 75 72 6e 20 | 72 65 74 76 61 6c 3b 0d |.return |retval;.|
|000054a0| 7d 0d 0d 70 61 73 63 61 | 6c 20 53 49 6e 74 31 36 |}..pasca|l SInt16|
|000054b0| 20 57 45 43 68 61 72 54 | 79 70 65 28 53 49 6e 74 | WECharT|ype(SInt|
|000054c0| 33 32 20 6f 66 66 73 65 | 74 2c 20 57 45 48 61 6e |32 offse|t, WEHan|
|000054d0| 64 6c 65 20 68 57 45 29 | 0d 7b 0d 09 57 45 50 74 |dle hWE)|.{..WEPt|
|000054e0| 72 20 70 57 45 3b 0d 09 | 48 61 6e 64 6c 65 20 68 |r pWE;..|Handle h|
|000054f0| 54 65 78 74 3b 0d 09 53 | 49 6e 74 33 32 20 63 6f |Text;..S|Int32 co|
|00005500| 6e 74 65 78 74 53 74 61 | 72 74 2c 20 63 6f 6e 74 |ntextSta|rt, cont|
|00005510| 65 78 74 45 6e 64 3b 0d | 09 53 63 72 69 70 74 43 |extEnd;.|.ScriptC|
|00005520| 6f 64 65 20 73 63 72 69 | 70 74 3b 0d 09 42 6f 6f |ode scri|pt;..Boo|
|00005530| 6c 65 61 6e 20 73 61 76 | 65 57 45 4c 6f 63 6b 2c |lean sav|eWELock,|
|00005540| 20 73 61 76 65 54 65 78 | 74 4c 6f 63 6b 3b 0d 09 | saveTex|tLock;..|
|00005550| 53 49 6e 74 31 36 20 72 | 65 74 76 61 6c 20 3d 20 |SInt16 r|etval = |
|00005560| 30 3b 0d 0d 09 2f 2f 20 | 6c 6f 63 6b 20 74 68 65 |0;...// |lock the|
|00005570| 20 57 45 20 72 65 63 6f | 72 64 0d 09 73 61 76 65 | WE reco|rd..save|
|00005580| 57 45 4c 6f 63 6b 20 3d | 20 5f 57 45 53 65 74 48 |WELock =| _WESetH|
|00005590| 61 6e 64 6c 65 4c 6f 63 | 6b 28 28 48 61 6e 64 6c |andleLoc|k((Handl|
|000055a0| 65 29 20 68 57 45 2c 20 | 74 72 75 65 29 3b 0d 09 |e) hWE, |true);..|
|000055b0| 70 57 45 20 3d 20 2a 68 | 57 45 3b 0d 0d 09 2f 2f |pWE = *h|WE;...//|
|000055c0| 20 6d 61 6b 65 20 73 75 | 72 65 20 6f 66 66 73 65 | make su|re offse|
|000055d0| 74 20 69 73 20 77 69 74 | 68 69 6e 20 61 6c 6c 6f |t is wit|hin allo|
|000055e0| 77 65 64 20 62 6f 75 6e | 64 73 0d 09 69 66 20 28 |wed boun|ds..if (|
|000055f0| 28 6f 66 66 73 65 74 20 | 3e 3d 20 30 29 20 26 26 |(offset |>= 0) &&|
|00005600| 20 28 6f 66 66 73 65 74 | 20 3c 20 70 57 45 2d 3e | (offset| < pWE->|
|00005610| 74 65 78 74 4c 65 6e 67 | 74 68 29 29 0d 09 7b 0d |textLeng|th))..{.|
|00005620| 0d 09 09 2f 2f 20 66 69 | 6e 64 20 61 20 73 63 72 |...// fi|nd a scr|
|00005630| 69 70 74 20 63 6f 6e 74 | 65 78 74 20 63 6f 6e 74 |ipt cont|ext cont|
|00005640| 61 69 6e 69 6e 67 20 74 | 68 65 20 73 70 65 63 69 |aining t|he speci|
|00005650| 66 69 65 64 20 6f 66 66 | 73 65 74 0d 09 09 73 63 |fied off|set...sc|
|00005660| 72 69 70 74 20 3d 20 5f | 57 45 47 65 74 52 65 73 |ript = _|WEGetRes|
|00005670| 74 72 69 63 74 65 64 43 | 6f 6e 74 65 78 74 28 6f |trictedC|ontext(o|
|00005680| 66 66 73 65 74 2c 20 26 | 63 6f 6e 74 65 78 74 53 |ffset, &|contextS|
|00005690| 74 61 72 74 2c 20 26 63 | 6f 6e 74 65 78 74 45 6e |tart, &c|ontextEn|
|000056a0| 64 2c 20 68 57 45 29 3b | 0d 0d 09 09 2f 2f 20 6c |d, hWE);|....// l|
|000056b0| 6f 63 6b 20 74 68 65 20 | 74 65 78 74 0d 09 09 68 |ock the |text...h|
|000056c0| 54 65 78 74 20 3d 20 70 | 57 45 2d 3e 68 54 65 78 |Text = p|WE->hTex|
|000056d0| 74 3b 0d 09 09 73 61 76 | 65 54 65 78 74 4c 6f 63 |t;...sav|eTextLoc|
|000056e0| 6b 20 3d 20 5f 57 45 53 | 65 74 48 61 6e 64 6c 65 |k = _WES|etHandle|
|000056f0| 4c 6f 63 6b 28 68 54 65 | 78 74 2c 20 74 72 75 65 |Lock(hTe|xt, true|
|00005700| 29 3b 0d 0d 09 09 2f 2f | 20 70 61 73 73 20 74 68 |);....//| pass th|
|00005710| 65 20 43 68 61 72 54 79 | 70 65 20 68 6f 6f 6b 20 |e CharTy|pe hook |
|00005720| 61 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 74 68 65 |a pointe|r to the|
|00005730| 20 62 65 67 69 6e 6e 69 | 6e 67 20 6f 66 20 74 68 | beginni|ng of th|
|00005740| 65 20 73 74 79 6c 65 20 | 72 75 6e 0d 09 09 72 65 |e style |run...re|
|00005750| 74 76 61 6c 20 3d 20 43 | 61 6c 6c 57 45 43 68 61 |tval = C|allWECha|
|00005760| 72 54 79 70 65 50 72 6f | 63 28 2a 68 54 65 78 74 |rTypePro|c(*hText|
|00005770| 20 2b 20 63 6f 6e 74 65 | 78 74 53 74 61 72 74 2c | + conte|xtStart,|
|00005780| 0d 09 09 09 6f 66 66 73 | 65 74 20 2d 20 63 6f 6e |....offs|et - con|
|00005790| 74 65 78 74 53 74 61 72 | 74 2c 20 73 63 72 69 70 |textStar|t, scrip|
|000057a0| 74 2c 20 68 57 45 2c 20 | 70 57 45 2d 3e 63 68 61 |t, hWE, |pWE->cha|
|000057b0| 72 54 79 70 65 48 6f 6f | 6b 29 3b 0d 0d 09 09 2f |rTypeHoo|k);..../|
|000057c0| 2f 20 75 6e 6c 6f 63 6b | 20 74 68 65 20 74 65 78 |/ unlock| the tex|
|000057d0| 74 0d 09 09 5f 57 45 53 | 65 74 48 61 6e 64 6c 65 |t..._WES|etHandle|
|000057e0| 4c 6f 63 6b 28 68 54 65 | 78 74 2c 20 73 61 76 65 |Lock(hTe|xt, save|
|000057f0| 54 65 78 74 4c 6f 63 6b | 29 3b 0d 09 7d 0d 0d 09 |TextLock|);..}...|
|00005800| 2f 2f 20 75 6e 6c 6f 63 | 6b 20 74 68 65 20 57 45 |// unloc|k the WE|
|00005810| 20 72 65 63 6f 72 64 0d | 09 5f 57 45 53 65 74 48 | record.|._WESetH|
|00005820| 61 6e 64 6c 65 4c 6f 63 | 6b 28 28 48 61 6e 64 6c |andleLoc|k((Handl|
|00005830| 65 29 20 68 57 45 2c 20 | 73 61 76 65 57 45 4c 6f |e) hWE, |saveWELo|
|00005840| 63 6b 29 3b 0d 0d 09 72 | 65 74 75 72 6e 20 72 65 |ck);...r|eturn re|
|00005850| 74 76 61 6c 3b 0d 7d 0d | 0d 70 61 73 63 61 6c 20 |tval;.}.|.pascal |
|00005860| 76 6f 69 64 20 5f 57 45 | 47 65 74 43 61 72 65 74 |void _WE|GetCaret|
|00005870| 52 65 63 74 28 53 49 6e | 74 33 32 20 6f 66 66 73 |Rect(SIn|t32 offs|
|00005880| 65 74 2c 20 53 49 6e 74 | 31 36 20 64 69 72 65 63 |et, SInt|16 direc|
|00005890| 74 69 6f 6e 2c 20 52 65 | 63 74 20 2a 63 61 72 65 |tion, Re|ct *care|
|000058a0| 74 52 65 63 74 2c 20 57 | 45 48 61 6e 64 6c 65 20 |tRect, W|EHandle |
|000058b0| 68 57 45 29 0d 7b 0d 09 | 4c 6f 6e 67 50 74 20 74 |hWE).{..|LongPt t|
|000058c0| 68 65 50 6f 69 6e 74 3b | 0d 09 53 49 6e 74 31 36 |hePoint;|..SInt16|
|000058d0| 20 63 61 72 65 74 48 65 | 69 67 68 74 3b 0d 0d 09 | caretHe|ight;...|
|000058e0| 57 45 47 65 74 50 6f 69 | 6e 74 28 6f 66 66 73 65 |WEGetPoi|nt(offse|
|000058f0| 74 2c 20 64 69 72 65 63 | 74 69 6f 6e 2c 20 26 74 |t, direc|tion, &t|
|00005900| 68 65 50 6f 69 6e 74 2c | 20 26 63 61 72 65 74 48 |hePoint,| &caretH|
|00005910| 65 69 67 68 74 2c 20 68 | 57 45 29 3b 0d 09 57 45 |eight, h|WE);..WE|
|00005920| 4c 6f 6e 67 50 6f 69 6e | 74 54 6f 50 6f 69 6e 74 |LongPoin|tToPoint|
|00005930| 28 26 74 68 65 50 6f 69 | 6e 74 2c 20 28 50 6f 69 |(&thePoi|nt, (Poi|
|00005940| 6e 74 20 2a 29 20 26 63 | 61 72 65 74 52 65 63 74 |nt *) &c|aretRect|
|00005950| 2d 3e 74 6f 70 29 3b 0d | 09 69 66 20 28 63 61 72 |->top);.|.if (car|
|00005960| 65 74 52 65 63 74 2d 3e | 6c 65 66 74 20 3e 20 28 |etRect->|left > (|
|00005970| 2a 68 57 45 29 2d 3e 64 | 65 73 74 52 65 63 74 2e |*hWE)->d|estRect.|
|00005980| 6c 65 66 74 29 0d 09 7b | 0d 09 09 63 61 72 65 74 |left)..{|...caret|
|00005990| 52 65 63 74 2d 3e 6c 65 | 66 74 2d 2d 3b 0d 09 7d |Rect->le|ft--;..}|
|000059a0| 0d 0d 09 63 61 72 65 74 | 52 65 63 74 2d 3e 62 6f |...caret|Rect->bo|
|000059b0| 74 74 6f 6d 20 3d 20 63 | 61 72 65 74 52 65 63 74 |ttom = c|aretRect|
|000059c0| 2d 3e 74 6f 70 20 2b 20 | 63 61 72 65 74 48 65 69 |->top + |caretHei|
|000059d0| 67 68 74 3b 0d 09 63 61 | 72 65 74 52 65 63 74 2d |ght;..ca|retRect-|
|000059e0| 3e 72 69 67 68 74 20 3d | 20 63 61 72 65 74 52 65 |>right =| caretRe|
|000059f0| 63 74 2d 3e 6c 65 66 74 | 20 2b 20 6b 43 61 72 65 |ct->left| + kCare|
|00005a00| 74 57 69 64 74 68 3b 0d | 7d 0d 0d 70 61 73 63 61 |tWidth;.|}..pasca|
|00005a10| 6c 20 76 6f 69 64 20 5f | 57 45 44 72 61 77 43 61 |l void _|WEDrawCa|
|00005a20| 72 65 74 28 53 49 6e 74 | 33 32 20 6f 66 66 73 65 |ret(SInt|32 offse|
|00005a30| 74 2c 20 53 49 6e 74 31 | 36 20 64 69 72 65 63 74 |t, SInt1|6 direct|
|00005a40| 69 6f 6e 2c 20 42 6f 6f | 6c 65 61 6e 20 75 73 65 |ion, Boo|lean use|
|00005a50| 44 75 61 6c 43 61 72 65 | 74 2c 20 57 45 48 61 6e |DualCare|t, WEHan|
|00005a60| 64 6c 65 20 68 57 45 29 | 0d 7b 0d 09 57 45 50 74 |dle hWE)|.{..WEPt|
|00005a70| 72 20 70 57 45 20 3d 20 | 2a 68 57 45 3b 09 2f 2f |r pWE = |*hWE;.//|
|00005a80| 20 61 73 73 75 6d 65 20 | 57 45 20 72 65 63 6f 72 | assume |WE recor|
|00005a90| 64 20 69 73 20 61 6c 72 | 65 61 64 79 20 6c 6f 63 |d is alr|eady loc|
|00005aa0| 6b 65 64 0d 09 52 65 63 | 74 20 63 61 72 65 74 52 |ked..Rec|t caretR|
|00005ab0| 65 63 74 3b 0d 09 47 72 | 61 66 50 74 72 20 73 61 |ect;..Gr|afPtr sa|
|00005ac0| 76 65 50 6f 72 74 3b 0d | 09 52 67 6e 48 61 6e 64 |vePort;.|.RgnHand|
|00005ad0| 6c 65 20 73 61 76 65 43 | 6c 69 70 2c 20 61 75 78 |le saveC|lip, aux|
|00005ae0| 52 67 6e 3b 0d 0d 09 2f | 2f 20 73 65 74 20 75 70 |Rgn;.../|/ set up|
|00005af0| 20 74 68 65 20 70 6f 72 | 74 0d 09 47 65 74 50 6f | the por|t..GetPo|
|00005b00| 72 74 28 26 73 61 76 65 | 50 6f 72 74 29 3b 0d 09 |rt(&save|Port);..|
|00005b10| 53 65 74 50 6f 72 74 28 | 70 57 45 2d 3e 70 6f 72 |SetPort(|pWE->por|
|00005b20| 74 29 3b 0d 0d 09 2f 2f | 20 73 61 76 65 20 74 68 |t);...//| save th|
|00005b30| 65 20 63 6c 69 70 20 72 | 65 67 69 6f 6e 0d 09 73 |e clip r|egion..s|
|00005b40| 61 76 65 43 6c 69 70 20 | 3d 20 4e 65 77 52 67 6e |aveClip |= NewRgn|
|00005b50| 28 29 3b 0d 09 47 65 74 | 43 6c 69 70 28 73 61 76 |();..Get|Clip(sav|
|00005b60| 65 43 6c 69 70 29 3b 0d | 0d 09 2f 2f 20 72 65 73 |eClip);.|..// res|
|00005b70| 74 72 69 63 74 20 74 68 | 65 20 63 6c 69 70 20 72 |trict th|e clip r|
|00005b80| 65 67 69 6f 6e 20 74 6f | 20 74 68 65 20 76 69 65 |egion to| the vie|
|00005b90| 77 20 72 65 67 69 6f 6e | 0d 09 61 75 78 52 67 6e |w region|..auxRgn|
|00005ba0| 20 3d 20 4e 65 77 52 67 | 6e 28 29 3b 0d 09 53 65 | = NewRg|n();..Se|
|00005bb0| 63 74 52 67 6e 28 73 61 | 76 65 43 6c 69 70 2c 20 |ctRgn(sa|veClip, |
|00005bc0| 70 57 45 2d 3e 76 69 65 | 77 52 67 6e 2c 20 61 75 |pWE->vie|wRgn, au|
|00005bd0| 78 52 67 6e 29 3b 0d 09 | 53 65 74 43 6c 69 70 28 |xRgn);..|SetClip(|
|00005be0| 61 75 78 52 67 6e 29 3b | 0d 09 44 69 73 70 6f 73 |auxRgn);|..Dispos|
|00005bf0| 65 52 67 6e 28 61 75 78 | 52 67 6e 29 3b 0d 0d 09 |eRgn(aux|Rgn);...|
|00005c00| 2f 2f 20 63 61 6c 63 75 | 6c 61 74 65 20 63 61 72 |// calcu|late car|
|00005c10| 65 74 20 72 65 63 74 61 | 6e 67 6c 65 20 66 6f 72 |et recta|ngle for|
|00005c20| 20 74 68 65 20 70 72 69 | 6d 61 72 79 20 63 61 72 | the pri|mary car|
|00005c30| 65 74 0d 09 5f 57 45 47 | 65 74 43 61 72 65 74 52 |et.._WEG|etCaretR|
|00005c40| 65 63 74 28 6f 66 66 73 | 65 74 2c 20 64 69 72 65 |ect(offs|et, dire|
|00005c50| 63 74 69 6f 6e 2c 20 26 | 63 61 72 65 74 52 65 63 |ction, &|caretRec|
|00005c60| 74 2c 20 68 57 45 29 3b | 0d 0d 09 2f 2f 20 73 68 |t, hWE);|...// sh|
|00005c70| 6f 75 6c 64 20 77 65 20 | 75 73 65 20 61 20 64 75 |ould we |use a du|
|00005c80| 61 6c 20 63 61 72 65 74 | 3f 0d 09 69 66 20 28 75 |al caret|?..if (u|
|00005c90| 73 65 44 75 61 6c 43 61 | 72 65 74 29 0d 09 7b 0d |seDualCa|ret)..{.|
|00005ca0| 09 09 2f 2f 20 64 72 61 | 77 20 74 68 65 20 70 72 |..// dra|w the pr|
|00005cb0| 69 6d 61 72 79 20 63 61 | 72 65 74 0d 09 09 63 61 |imary ca|ret...ca|
|00005cc0| 72 65 74 52 65 63 74 2e | 62 6f 74 74 6f 6d 20 3d |retRect.|bottom =|
|00005cd0| 20 28 63 61 72 65 74 52 | 65 63 74 2e 74 6f 70 20 | (caretR|ect.top |
|00005ce0| 2b 20 63 61 72 65 74 52 | 65 63 74 2e 62 6f 74 74 |+ caretR|ect.bott|
|00005cf0| 6f 6d 29 20 3e 3e 20 31 | 3b 0d 09 09 49 6e 76 65 |om) >> 1|;...Inve|
|00005d00| 72 74 52 65 63 74 28 26 | 63 61 72 65 74 52 65 63 |rtRect(&|caretRec|
|00005d10| 74 29 3b 0d 0d 09 09 2f | 2f 20 63 61 6c 63 75 6c |t);..../|/ calcul|
|00005d20| 61 74 65 20 74 68 65 20 | 63 61 72 65 74 20 72 65 |ate the |caret re|
|00005d30| 63 74 61 6e 67 6c 65 20 | 66 6f 72 20 74 68 65 20 |ctangle |for the |
|00005d40| 73 65 63 6f 6e 64 61 72 | 79 20 63 61 72 65 74 0d |secondar|y caret.|
|00005d50| 09 09 5f 57 45 47 65 74 | 43 61 72 65 74 52 65 63 |.._WEGet|CaretRec|
|00005d60| 74 28 6f 66 66 73 65 74 | 2c 20 28 6c 65 66 74 43 |t(offset|, (leftC|
|00005d70| 61 72 65 74 20 2b 20 72 | 69 67 68 74 43 61 72 65 |aret + r|ightCare|
|00005d80| 74 29 20 2d 20 64 69 72 | 65 63 74 69 6f 6e 2c 20 |t) - dir|ection, |
|00005d90| 26 63 61 72 65 74 52 65 | 63 74 2c 20 68 57 45 29 |&caretRe|ct, hWE)|
|00005da0| 3b 0d 09 09 63 61 72 65 | 74 52 65 63 74 2e 74 6f |;...care|tRect.to|
|00005db0| 70 20 3d 20 28 63 61 72 | 65 74 52 65 63 74 2e 74 |p = (car|etRect.t|
|00005dc0| 6f 70 20 2b 20 63 61 72 | 65 74 52 65 63 74 2e 62 |op + car|etRect.b|
|00005dd0| 6f 74 74 6f 6d 29 20 3e | 3e 20 31 3b 0d 09 7d 0d |ottom) >|> 1;..}.|
|00005de0| 0d 09 2f 2f 20 64 72 61 | 77 20 74 68 65 20 63 61 |..// dra|w the ca|
|00005df0| 72 65 74 20 28 65 69 74 | 68 65 72 20 61 20 73 69 |ret (eit|her a si|
|00005e00| 6e 67 6c 65 20 63 61 72 | 65 74 2c 20 6f 72 20 74 |ngle car|et, or t|
|00005e10| 68 65 20 73 65 63 6f 6e | 64 61 72 79 20 63 61 72 |he secon|dary car|
|00005e20| 65 74 29 0d 09 49 6e 76 | 65 72 74 52 65 63 74 28 |et)..Inv|ertRect(|
|00005e30| 26 63 61 72 65 74 52 65 | 63 74 29 3b 0d 0d 09 2f |&caretRe|ct);.../|
|00005e40| 2f 20 72 65 73 74 6f 72 | 65 20 74 68 65 20 63 6c |/ restor|e the cl|
|00005e50| 69 70 20 72 65 67 69 6f | 6e 0d 09 53 65 74 43 6c |ip regio|n..SetCl|
|00005e60| 69 70 28 73 61 76 65 43 | 6c 69 70 29 3b 0d 09 44 |ip(saveC|lip);..D|
|00005e70| 69 73 70 6f 73 65 52 67 | 6e 28 73 61 76 65 43 6c |isposeRg|n(saveCl|
|00005e80| 69 70 29 3b 0d 0d 09 2f | 2f 20 72 65 73 74 6f 72 |ip);.../|/ restor|
|00005e90| 65 20 74 68 65 20 70 6f | 72 74 0d 09 53 65 74 50 |e the po|rt..SetP|
|00005ea0| 6f 72 74 28 73 61 76 65 | 50 6f 72 74 29 3b 0d 7d |ort(save|Port);.}|
|00005eb0| 0d 0d 70 61 73 63 61 6c | 20 76 6f 69 64 20 5f 57 |..pascal| void _W|
|00005ec0| 45 42 6c 69 6e 6b 43 61 | 72 65 74 28 57 45 48 61 |EBlinkCa|ret(WEHa|
|00005ed0| 6e 64 6c 65 20 68 57 45 | 29 0d 7b 0d 09 57 45 50 |ndle hWE|).{..WEP|
|00005ee0| 74 72 20 70 57 45 20 3d | 20 2a 68 57 45 3b 09 09 |tr pWE =| *hWE;..|
|00005ef0| 09 09 2f 2f 20 61 73 73 | 75 6d 65 20 57 45 20 72 |..// ass|ume WE r|
|00005f00| 65 63 6f 72 64 20 69 73 | 20 61 6c 72 65 61 64 79 |ecord is| already|
|00005f10| 20 6c 6f 63 6b 65 64 0d | 09 53 49 6e 74 31 36 20 | locked.|.SInt16 |
|00005f20| 64 69 72 65 63 74 69 6f | 6e 20 3d 20 68 69 6c 69 |directio|n = hili|
|00005f30| 74 65 3b 0d 09 42 6f 6f | 6c 65 61 6e 20 75 73 65 |te;..Boo|lean use|
|00005f40| 44 75 61 6c 43 61 72 65 | 74 20 3d 20 66 61 6c 73 |DualCare|t = fals|
|00005f50| 65 3b 0d 0d 09 2f 2f 20 | 64 6f 20 6e 6f 74 68 69 |e;...// |do nothi|
|00005f60| 6e 67 20 69 66 20 77 65 | 27 72 65 20 6e 6f 74 20 |ng if we|'re not |
|00005f70| 61 63 74 69 76 65 0d 09 | 69 66 20 28 21 42 54 53 |active..|if (!BTS|
|00005f80| 54 28 70 57 45 2d 3e 66 | 6c 61 67 73 2c 20 77 65 |T(pWE->f|lags, we|
|00005f90| 46 41 63 74 69 76 65 29 | 29 0d 09 7b 0d 09 09 72 |FActive)|)..{...r|
|00005fa0| 65 74 75 72 6e 3b 0d 09 | 7d 0d 0d 23 69 66 20 57 |eturn;..|}..#if W|
|00005fb0| 41 53 54 45 5f 4e 4f 5f | 52 4f 5f 43 41 52 45 54 |ASTE_NO_|RO_CARET|
|00005fc0| 0d 09 69 66 20 28 42 54 | 53 54 28 70 57 45 2d 3e |..if (BT|ST(pWE->|
|00005fd0| 66 65 61 74 75 72 65 73 | 2c 20 77 65 46 52 65 61 |features|, weFRea|
|00005fe0| 64 4f 6e 6c 79 29 20 26 | 26 20 21 42 54 53 54 28 |dOnly) &|& !BTST(|
|00005ff0| 70 57 45 2d 3e 66 6c 61 | 67 73 2c 20 77 65 46 43 |pWE->fla|gs, weFC|
|00006000| 61 72 65 74 56 69 73 69 | 62 6c 65 29 29 0d 09 7b |aretVisi|ble))..{|
|00006010| 0d 09 09 72 65 74 75 72 | 6e 3b 0d 09 7d 0d 23 65 |...retur|n;..}.#e|
|00006020| 6e 64 69 66 0d 0d 09 69 | 66 20 28 42 54 53 54 28 |ndif...i|f (BTST(|
|00006030| 70 57 45 2d 3e 66 6c 61 | 67 73 2c 20 77 65 46 42 |pWE->fla|gs, weFB|
|00006040| 69 64 69 72 65 63 74 69 | 6f 6e 61 6c 29 29 0d 09 |idirecti|onal))..|
|00006050| 7b 0d 09 09 2f 2f 20 53 | 50 45 43 49 41 4c 20 50 |{...// S|PECIAL P|
|00006060| 52 4f 43 45 53 53 49 4e | 47 20 46 4f 52 20 42 49 |ROCESSIN|G FOR BI|
|00006070| 44 49 52 45 43 54 49 4f | 4e 41 4c 20 53 43 52 49 |DIRECTIO|NAL SCRI|
|00006080| 50 54 53 0d 09 09 2f 2f | 20 63 68 65 63 6b 20 69 |PTS...//| check i|
|00006090| 66 20 77 65 20 73 68 6f | 75 6c 64 20 75 73 65 20 |f we sho|uld use |
|000060a0| 61 20 64 75 61 6c 20 63 | 61 72 65 74 0d 09 09 69 |a dual c|aret...i|
|000060b0| 66 20 28 42 54 53 54 28 | 47 65 74 53 63 72 69 70 |f (BTST(|GetScrip|
|000060c0| 74 4d 61 6e 61 67 65 72 | 56 61 72 69 61 62 6c 65 |tManager|Variable|
|000060d0| 28 73 6d 47 65 6e 46 6c | 61 67 73 29 2c 20 73 6d |(smGenFl|ags), sm|
|000060e0| 66 44 75 61 6c 43 61 72 | 65 74 29 29 0d 09 09 7b |fDualCar|et))...{|
|000060f0| 0d 09 09 09 2f 2f 09 44 | 55 41 4c 20 43 41 52 45 |....//.D|UAL CARE|
|00006100| 54 0d 09 09 09 75 73 65 | 44 75 61 6c 43 61 72 65 |T....use|DualCare|
|00006110| 74 20 3d 20 74 72 75 65 | 3b 0d 0d 09 09 09 2f 2f |t = true|;.....//|
|00006120| 09 70 72 69 6d 61 72 79 | 20 63 61 72 65 74 20 70 |.primary| caret p|
|00006130| 6f 73 69 74 69 6f 6e 20 | 64 65 70 65 6e 64 73 20 |osition |depends |
|00006140| 6f 6e 20 70 72 69 6d 61 | 72 79 20 6c 69 6e 65 20 |on prima|ry line |
|00006150| 64 69 72 65 63 74 69 6f | 6e 0d 09 09 09 64 69 72 |directio|n....dir|
|00006160| 65 63 74 69 6f 6e 20 3d | 20 49 73 52 69 67 68 74 |ection =| IsRight|
|00006170| 54 6f 4c 65 66 74 28 70 | 57 45 2d 3e 64 69 72 65 |ToLeft(p|WE->dire|
|00006180| 63 74 69 6f 6e 29 20 3f | 20 72 69 67 68 74 43 61 |ction) ?| rightCa|
|00006190| 72 65 74 20 3a 20 6c 65 | 66 74 43 61 72 65 74 3b |ret : le|ftCaret;|
|000061a0| 0d 09 09 7d 0d 09 09 65 | 6c 73 65 0d 09 09 7b 0d |...}...e|lse...{.|
|000061b0| 09 09 09 2f 2f 09 53 49 | 4e 47 4c 45 20 28 4a 55 |...//.SI|NGLE (JU|
|000061c0| 4d 50 49 4e 47 29 20 43 | 41 52 45 54 0d 09 09 09 |MPING) C|ARET....|
|000061d0| 2f 2f 09 63 61 72 65 74 | 20 70 6f 73 69 74 69 6f |//.caret| positio|
|000061e0| 6e 20 64 65 70 65 6e 64 | 73 20 6f 6e 20 6b 65 79 |n depend|s on key|
|000061f0| 73 63 72 69 70 74 20 64 | 69 72 65 63 74 69 6f 6e |script d|irection|
|00006200| 0d 09 09 09 2f 2f 09 77 | 68 65 6e 20 65 72 61 73 |....//.w|hen eras|
|00006210| 69 6e 67 2c 20 74 68 6f | 75 67 68 2c 20 75 73 65 |ing, tho|ugh, use|
|00006220| 20 70 72 65 76 69 6f 75 | 73 6c 79 20 75 73 65 64 | previou|sly used|
|00006230| 20 64 69 72 65 63 74 69 | 6f 6e 0d 09 09 09 2f 2f | directi|on....//|
|00006240| 09 69 6e 20 63 61 73 65 | 20 6b 65 79 73 63 72 69 |.in case| keyscri|
|00006250| 70 74 20 63 68 61 6e 67 | 65 64 20 69 6e 20 74 68 |pt chang|ed in th|
|00006260| 65 20 6d 65 61 6e 74 69 | 6d 65 0d 09 09 09 69 66 |e meanti|me....if|
|00006270| 20 28 42 54 53 54 28 70 | 57 45 2d 3e 66 6c 61 67 | (BTST(p|WE->flag|
|00006280| 73 2c 20 77 65 46 43 61 | 72 65 74 56 69 73 69 62 |s, weFCa|retVisib|
|00006290| 6c 65 29 29 0d 09 09 09 | 7b 0d 09 09 09 09 64 69 |le))....|{.....di|
|000062a0| 72 65 63 74 69 6f 6e 20 | 3d 20 42 54 53 54 28 70 |rection |= BTST(p|
|000062b0| 57 45 2d 3e 66 6c 61 67 | 73 2c 20 77 65 46 43 61 |WE->flag|s, weFCa|
|000062c0| 72 65 74 52 69 67 68 74 | 29 20 3f 20 72 69 67 68 |retRight|) ? righ|
|000062d0| 74 43 61 72 65 74 20 3a | 20 6c 65 66 74 43 61 72 |tCaret :| leftCar|
|000062e0| 65 74 3b 0d 09 09 09 7d | 0d 09 09 09 65 6c 73 65 |et;....}|....else|
|000062f0| 0d 09 09 09 7b 0d 09 09 | 09 09 69 66 20 28 47 65 |....{...|..if (Ge|
|00006300| 74 53 63 72 69 70 74 56 | 61 72 69 61 62 6c 65 28 |tScriptV|ariable(|
|00006310| 47 65 74 53 63 72 69 70 | 74 4d 61 6e 61 67 65 72 |GetScrip|tManager|
|00006320| 56 61 72 69 61 62 6c 65 | 28 73 6d 4b 65 79 53 63 |Variable|(smKeySc|
|00006330| 72 69 70 74 29 2c 20 73 | 6d 53 63 72 69 70 74 52 |ript), s|mScriptR|
|00006340| 69 67 68 74 29 29 0d 09 | 09 09 09 7b 0d 09 09 09 |ight))..|...{....|
|00006350| 09 09 64 69 72 65 63 74 | 69 6f 6e 20 3d 20 72 69 |..direct|ion = ri|
|00006360| 67 68 74 43 61 72 65 74 | 3b 0d 09 09 09 09 09 42 |ghtCaret|;......B|
|00006370| 53 45 54 28 70 57 45 2d | 3e 66 6c 61 67 73 2c 20 |SET(pWE-|>flags, |
|00006380| 77 65 46 43 61 72 65 74 | 52 69 67 68 74 29 3b 0d |weFCaret|Right);.|
|00006390| 09 09 09 09 7d 0d 09 09 | 09 09 65 6c 73 65 0d 09 |....}...|..else..|
|000063a0| 09 09 09 7b 0d 09 09 09 | 09 09 64 69 72 65 63 74 |...{....|..direct|
|000063b0| 69 6f 6e 20 3d 20 6c 65 | 66 74 43 61 72 65 74 3b |ion = le|ftCaret;|
|000063c0| 0d 09 09 09 09 09 42 43 | 4c 52 28 70 57 45 2d 3e |......BC|LR(pWE->|
|000063d0| 66 6c 61 67 73 2c 20 77 | 65 46 43 61 72 65 74 52 |flags, w|eFCaretR|
|000063e0| 69 67 68 74 29 3b 0d 09 | 09 09 09 7d 0d 09 09 09 |ight);..|...}....|
|000063f0| 7d 0d 09 09 7d 0d 09 7d | 0d 0d 09 2f 2f 20 72 65 |}...}..}|...// re|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.